Search:

Type: Posts; User: Stiletto

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,925

    Ofcourse. Thank you.

    Ofcourse. Thank you.
  2. Replies
    2
    Views
    1,925

    Segmentation Fault on Free()

    Hello,
    When I try to free() the following allocated memory I get segmentation fault. Why is that and how can I slove this?
    Thanks in advance.


    typedef struct filterNode_st{
    void* data;...
  3. Can't edit original post, so I'm posting again...

    Can't edit original post, so I'm posting again for an easier review. I've made some changes to the code so it will be more clear and simple to me. Now only read() gives an error.
    How long should I...
  4. Proxy server using threads - Bad file descriptor error

    Hello,
    My program is a proxy server that uses a pre-defined thread pool in order to handle client requests. If the proxy gets HTTP 1.1 it changes it and sends the origin server HTTP 1.0 request.
    ...
  5. Hmmmm...With this I get the correct IP. I guess I...

    Hmmmm...With this I get the correct IP. I guess I should have thought about your solution :D, thanks.
  6. Retrieve IPv4 from Struct hostent (gethostbyname)

    Hello,
    How can I retrieve the IPv4 address numbers-and-dots notation of a host?
    For some reason, this example always prints 0.0.0.0. What am I missing?

    Thanks in advance.

    char* host="some...
  7. Replies
    4
    Views
    1,197

    I don't want to use malloc(). As far as I...

    I don't want to use malloc(). As far as I understand, I should use malloc() when only if I need to allocate memory dynamically. Here the size of the strings is fixed.
    Is there a way to do without...
  8. Replies
    4
    Views
    1,197

    Adding two strings into one string

    Hello,
    So I guess I have a problem with understanding the whole string issue in C, since i've been working on this little piece of code for a while now, trying to achieve what I want.

    Here is the...
  9. Replies
    11
    Views
    3,424

    OK guys, It's working now. Can someone please...

    OK guys, It's working now. Can someone please explain to me, since I would like to actually learn what happend here, why this is the right format?



    char host[100];
    char path[100];
    int...
  10. Replies
    11
    Views
    3,424

    I know I'm doing something wrong, obviously, this...

    I know I'm doing something wrong, obviously, this is not working. Can someone please show me the right way of doing this? not just about the parameters in sscanf, but also the structure of the...
  11. Replies
    11
    Views
    3,424

    Not char array, but simply 2 char pointers. Why...

    Not char array, but simply 2 char pointers. Why does this give me zero in port?


    char* host;
    int port;
    char* path;

    sscanf(someString,"http://%[^:]:%d/%[^\n]",&host,&port,&path);...
  12. Replies
    11
    Views
    3,424

    http://www.awebsite.com:80/index.html Ok, I...

    http://www.awebsite.com:80/index.html

    Ok, I have a bit of a progress here. This looks better, but I'm missing something here, and I dont understand how this really works. I get a different number...
  13. Replies
    11
    Views
    3,424

    Well, I would to extract the data from the...

    Well, I would to extract the data from the string. Sorry if I wasn't clear. I want to extract the protocol, the host and the port.
  14. Replies
    11
    Views
    3,424

    sscanf() issues

    Hello,
    I would like to check a string, using sscanf, for the format: "http://host:Port/path"

    I can't seem to figure it out. What format should I use?
    I currently have the following, but it...
  15. Replies
    1
    Views
    5,213

    Using free() to deallocate memory

    Hello,
    I use a structure type that I want to remove from memory at the end of the program. I came up with something but since i'm new to C, I was wondering, does this code free all the memory used?...
Results 1 to 15 of 15