Search:

Type: Posts; User: rikehmmc

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,301

    This is the function that sends the message to...

    This is the function that sends the message to the client:


    void send_file(int remotefd, char file_addr[], int http_subver){

    char *file;
    char buf[FILE_BUF_SIZE + 60];

    ...
  2. Replies
    2
    Views
    1,301

    Also the FILE_BUF_SIZE is currently set as 10k....

    Also the FILE_BUF_SIZE is currently set as 10k. The png I am trying to send is 3.5k, so there should be no problem there
  3. Replies
    2
    Views
    1,301

    Sending png to browser

    I'm trying to do a small web server. I want this server to send a png.

    The client browser sends the request:



    GET /someimage.png HTTP/1.1

    loads of information I don't care about
  4. Replies
    6
    Views
    2,717

    I think I may have found the problem. The last...

    I think I may have found the problem. The last argument of accept must be an initialized pointer to int. Thank you anduril462 ;)

    The mutex will be used when I have multiple threads accepting from...
  5. Replies
    6
    Views
    2,717

    This is the code to run in the server. It is...

    This is the code to run in the server. It is supposed to receive requests on port 8080. To test it I use that client.
  6. Replies
    6
    Views
    2,717

    Connect not working

    Hi, so I'm doing this code for a server.

    It is supposed to receive a message and answer it. I have code doing it successfuly, it was all in main and not really readable. I divided it in functions...
  7. Yes, but how do i use that in other header file?...

    Yes, but how do i use that in other header file? On the code file I just write #include "trees.h", however on the header file list.h it does not seem to work
  8. True, true... What about the using the less...

    True, true...

    What about the using the less pointer in other header files? It was defined this way

    int (*less) (Item, Item);
  9. I just want to hide what is in the structure. And...

    I just want to hide what is in the structure. And what do i do to use the less pointer in this function, that is used on list.c:


    void insert_in_list(NODE * list, NODE * new_node, int (*less)...
  10. I also want to use the less pointer in my list...

    I also want to use the less pointer in my list header file. How do I do that?
  11. What if I want to hide the structure definition...

    What if I want to hide the structure definition in the original header file? This one:

    typedef struct NODE{

    Item * item;

    struct NODE * right;
    struct NODE * left;

    }NODE;
  12. If i want to use this declaration of NODE in...

    If i want to use this declaration of NODE in another .c file i just need to include tree.h. But on the header file it does not work. What do I do?
  13. LOL. "Those dark ages...". well, my teacher...

    LOL. "Those dark ages...". well, my teacher taught me to cast a malloc and a calloc, I guess he lived in that awful time where people had to open brackets, write one word, maybe a little shiny star,...
  14. Thanks. So i modified this line ...

    Thanks. So i modified this line


    node->item = (Item*) calloc (strlen(word) +1, sizeof (char));

    and created the function


    int less_alphabetic (Item item1, Item item2){
  15. This is in a function that creates a tree data...

    This is in a function that creates a tree data base of words

    NODE * create_dictionary(FILE * fp){

    char * word ;
    NODE * tree;
    NODE * aux;

    tree = create_tree();
  16. But when the string is allocated I already do the...

    But when the string is allocated I already do the cast of the item in that structure to char *. Or it doesn't work this way?
  17. Now it's working, Thanks. How do I do a right...

    Now it's working, Thanks.

    How do I do a right casting of item? I did something like this


    item = (char*) malloc (sizeof (my_string));
    The debugger says it is an assignment form incompatible...
  18. It worked! Thank you =D New problem :/ im...

    It worked! Thank you =D

    New problem :/ im doing now a function that balances the tree when inserting. The debugger says "Dereferencing pointer to incomplete type" because of this:



    NODE *...
  19. Generic Trees Functions Using Pointers to Function

    I am trying to do some functions to manage trees that receive has argument pointers to functions.

    Item is declared like this:


    typedef void * Item;

    There is a structure called NODE:
Results 1 to 19 of 19