Closed Bug 86880 Opened 23 years ago Closed 23 years ago

NSPR 3.5.1 and 4.1 do not recognize ECONNABORTED

Categories

(NSPR :: NSPR, defect, P1)

3.5.1
Sun
Solaris
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Mark.Wahl, Assigned: wtc)

Details

Attachments

(2 files)

On Solaris and presumably other UNIXes like AIX the accept() system
call can return ECONNABORTED.  On Solaris see the man page for accept in 
section 3xn for a full list of errors (not the one in 3n).  In unix_errors.c 
I see that ECONNRESET and ECONNREFUSED are handled but not ECONNABORTED.  
When ECONNABORTED is returned by accept(), PR_Accept says it is an unknown 
error.  This occurs with iDS 5.0 and will also affect iDAR.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P1
Target Milestone: --- → 4.1.2
I checked in patch #1 (mapping ECONNABORTED to PR_CONNECT_ABORTED_ERROR)
on the trunk and NSPRPUB_RELEASE_4_1_BRANCH of NSPR.  This fix will be
in NSPR 4.1.2.
Marked the bug fixed.

Looping in PR_Accept() after getting ECONNABORTED
(patch #2) will be done in NSPR 4.2 and will be
tracked as a separate bug.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
I don't believe that looping in PR_Accept is the correct behavior.
In what bug number is that proposed change being tracked?
See W. Richard Stevens, Unix Network Programming, 2nd Ed., Vol. 1,
Section 5.11 "Connection Abort before accept Returns" on page 129.
(Bug #87493)
Imagine an application that uses PR_Poll to determine when a socket is 
ready to accept.  When PR_Poll says it's ready, the application calls 
PR_Accept.  Now imagine that the only connection read to be accepted
aborts.  If PR_Accept loops, the call will hang until the next connection
is received, no?
Yes, the PR_Accept call will hang.  The Berkeley socket
version of this problem is described in Stevens's book.

PR_Poll should only be used with non-blocking sockets.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: