When downloading files through Mongoose, there is a probability that the downloaded files are incomplete.

The software interaction process is as follows:

Browser < HTTP connection — — — — – > the web server mongoose < — — — — — > local TCP connection process of cgi





After careful analysis of the message, it was found that the connection between the CGI process and Mongoose was disconnected in a wrong way. Since CGI took the initiative to shut down, it should be the CGI end that sent FIN, but in fact CGI sent RST. Close sockets will pronounce RST instead of FIN in the following cases: When there is data in the receive buffer that has not been read by the application, if the application closes the socket, the protocol stack sends RST instead of FIN and discards the data in the send buffer that has not yet been sent.


For more information, please visit blog.coderhuo. Tech.