| ▲ | pdonis 6 hours ago | |||||||||||||
> When you close a socket with data in the send buffer That's not what's happening here. The server is closing the socket when there's data from the client that it hasn't read. | ||||||||||||||
| ▲ | Joker_vD 6 hours ago | parent [-] | |||||||||||||
Yep, and that makes implementing addition of "Connection: close" in an HTTP reply at the HTTP/1.1-server's side somewhat tricky: you ideally need to read all of the pipelined requests from the client before closing the connection, which is usually something you'd rather not do. But if you just close it, you risk your client getting a partial reply, so you better add "Content-Length"/"Transfer-Encoding: chunked" in your reply as well... but one common reason to do connection-close reply is when you don't know the content-length beforehand, so — I hope you implemented chunking correctly :) | ||||||||||||||
| ||||||||||||||