PR_Close should call shutdown before close on Windows

NEW
Assigned to

Status

13 years ago
12 years ago

People

(Reporter: nelson, Assigned: wtc)

Tracking

(Blocks: 1 bug)

4.1.1
x86
Windows 2000

Firefox Tracking Flags

(Not tracked)

Details

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
> or WSAECONNABORTED error.

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 https://bugzilla.mozilla.org/show_bug.cgi?id=64695#c26

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.