I am so frustrated by pset6, so much unfamiliar stuff here...... please help!

I have written all the 4 to-do functions, however if I go to the web server, no matter what I clicked, it shows no more than < ?.  

It seems a lot goes wrong.

**So I go to gdb**, setting the breakpoint at main, and find out the server.c falls into the line if(connected()) and does not show anything anymore.

I am confused because by if(connected()), it has not yet touched any of the 4 functions I wrote, there shouldn't be anything wrong....supposedly?

I really need advice, thanks!

Here is load:

    /**
     * Loads a file into memory dynamically allocated on heap.
     * Stores address thereof in *content and length thereof in *length.
     */
    bool load(FILE* file, BYTE** content, size_t* length)
    {
        // bsic settings
        int counter = 0;
        BYTE* buffer = malloc(1);
        
        while(fread(buffer, 1, 1, file) == 1)
        {
            counter = counter + 1;
        }
        
        buffer = realloc(buffer, counter + 1);
        fread(buffer, 1, counter, file);
        *(buffer+counter) = '\0';
        
        *content = buffer;
        *length = counter + 1;
        
        if (content == NULL || length == NULL)
        {
            return false;
        }
        
        return true;
        
    }