DevHeads.net

A question about why the function "recv" return 0

I am a website developer. We deploy a Nginx server on centos to provide HTTP services. Recently, some customers of our website were complaining about that occasionally they could not open the webpage, the web browser show that the tcp connection was reset. I checked the Nginx logs and source code and found that the function "recv" return 0 when some customers made HTTP requests. Our customers have confirmed that their network was ok at that time. Now, I could not find any clue about this issue. Is there any solution to find the reason? Does it have something to do with firewall, or ISP? Can we find something from the system log?

Comments

Re: A question about why the function "recv" return 0

By fred smith at 12/17/2018 - 13:58

On Mon, Dec 17, 2018 at 01:30:14PM +0800, yf chu wrote:
All my references say that recv() returns zero when the link has been
shut down cleanly by the other end.

You say that the other end hasn't done so, but possibly there are one
or more proxies in the middle,... maybe one of them has dropped the
link for some reason.

Re: A question about why the function "recv" return 0

By yf chu at 12/17/2018 - 20:57

I have used tcpdump to capture the data packets and found that after the ssl handshake, the client side reset the tcp connection.
Is there any method to pinpoint the culprit who drops the tcp connection?

At 2018-12-18 01:58:36, "Fred Smith" < ... at fcshome dot stoneham.ma.us> wrote:

Re: A question about why the function "recv" return 0

By Steven Tardy at 12/20/2018 - 08:21

<wild guesses>
Client doesn’t like TLS cypher list.
Client doesn’t have intermediate certificate.
Server needs intermediate certificate configured.
Client needs remote certificate “installed”.
Many more TLS issues.
</wild guesses>