PR_Close should call shutdown before close on Windows

Assigned to


13 years ago
12 years ago


(Reporter: nelson, Assigned: wtc)


(Blocks: 1 bug)

Windows 2000

Firefox Tracking Flags

(Not tracked)


In January 2001, in bug 66243, Sonja Mirtitsh wrote:

> According to [Wan-Teh], PR_Shutdown should be called befoe PR_Close on a 
> socket.  This is not necessary for Unix, only for Windows. 

And Wan-Teh added

> On some Windows versions (I don't remember whether it's
> the Windows 9x or NT family), if you don't call shutdown()
> before you close a socket, the peer may get the WSAECONNRESET

And I asked

> So, this is a platform dependent behavior issue.  Shouldn't NSPR fix 
> this by calling shutdown in PR_Close on the affected platform(s)?

This symtom (getting an unexpected ECONNRESET due to close without prior
shutdown) was also described in

This behavior is superficially the subject of bug 68869, which concerned 
the fact that a negative test case was resulting in a TCP socket error 
(ECONNRESET), not an SSL alert message, when the server ran on Windows NT/2K.
That problem occured in a case where libSSL _was_ shutting down the 
socket for both send and recv (equivalent to close in the TCP protocol) after 
sending an alert record, and the fix (or workaround) was to only shutdown the 
socket for send at that point.
QA Contact: wtchang → nspr
You need to log in before you can comment on or make changes to this bug.