This is the very last thing I seem to have to fix here. Telnet and GDB are returning no errors, but when I try to use my server.c
in Chrome, I don't get the requested page. Instead, I get an error on Chrome that says, "No data received; ERR_EMPTY_RESPONSE; Unable to load the webpage because the server sent no data."
I have no idea what could be causing this, so I don't know what to include as far as code. Telnet is telling me that the Content-Length
is -1
, if that helps at all.
I've seen few others with this problem. Any solutions?
EDIT - respond to client
// TODO: respond to client
printf("HTTP/1.1 200 OK\r\n");
printf("Connection: close\r\n");
printf("Content-Length: %i\r\n", load());
printf("Content-Type: %s\r\n", lookup(extension));