This is for a c++ implementation of http using winsock2. I'm sending the required headers, but because of the flow of the application, I cannot know the length of the content.
According to the protocol, closing the connection should signal a normal end to the body as long as I specify Connection: close
in the headers, which I'm doing.
Right after sending the body, I call closesocket(socket)
to close the connection, but chrome puts out an error saying The connection was reset.
.
If I comment that out, it displays the body, but never finishes loading since the connection is still active.
Am I closing the socket in the wrong way? Or am I missing something with the http protocol with regards to the end of content?
I've been reading up on this all day and I'm coming up with nothing