Turns out I forgot a CRLF at the end. Oops.
Hello, can someone help me on PSET6 making a web server? I basically have everything done except the part where I have to write data to the client/browser. If I understand correctly I would just write whatever was in the buffer to the client with:
write(cfd, body, length) //length is the total bytes in the buffer
I assume that would be it because aren't I writing the whole file the client requested? Anyhow, it doesn't seem to work, any expertise?
Thanks for any help!
Here's the url of the code: http://postimg.org/image/5bw92mogf/
And might I add, when I do add another write function to the code, and then request with the browser "/cat.html". I do get 200 OK, and the page does load but not the picture (I checked chmod). On the other hand when I request "/hello.html" I get 200 OK and the everything works fine. I think it has to do with how much I write to the client/browser but shouldn't one write function be enough?