Closed
Bug 42900
Opened 24 years ago
Closed 24 years ago
PR_Connect doesn't time out in the NT version
Categories
(NSPR :: NSPR, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
4.1
People
(Reporter: wtc, Assigned: wtc)
Details
Attachments
(2 files)
1.92 KB,
text/plain
|
Details | |
7.30 KB,
patch
|
Details | Diff | Splinter Review |
In the NT version of NSPR, PR_Connect does not time out. The timeout argument is ignored, and PR_Connect blocks until the native connect function returns. This bug is present in all NSPR releases.
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → 4.1
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
In the patch (attachment id=11538) I also cleaned up the code in _PR_MD_CONNECT for the nonblocking case, but it is the blocking case that's interesting. In the blocking case, the only way to wait with a timeout is to initiate a non-blocking connect and wait in select, which supports timeout. So I set the socket non-blocking temporarily, initiate a non-blocking connect, wait in select for the completion of the non-blocking connect, and then set the socket back to blocking. I've tested this code with the test case conn.c. Invoke the test on a host name that has a DNS entry but isn't on the network. For example, ebola.mcom.com is such a machine in our network: conn ebola.mcom.com The test correctly times out with the error code -5990 (PR_IO_TIMEOUT_ERROR) after two seconds. I checked in the patch (on the main trunk). /cvsroot/mozilla/nsprpub/pr/src/md/windows/ntio.c, revision 3.32
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•