selfserv cannot complete a connection in multi-process mode in OS_TARGET=WINNT build



12 years ago
4 years ago


(Reporter: julien.pierre, Unassigned)


(Depends on: 1 bug)

Windows 2000

Firefox Tracking Flags

(Not tracked)




12 years ago
When building OS_TARGET=WINNT and running selfserv with the -M 2 argument, it is not possible to complete an SSL connection. The client waits for the server forever.

If I comment out the PR_SetSocketOption call that sets the PR_SockOpt_Linger option to 1 second in selfserv.c, then the server works fine .

I have been unable to debug deeply into the server failure because the connection always works fine inside the debugger even with linger.

Comment 1

12 years ago
It looks like the problem is also due to a PR_Close failure. I asserted that PR_Close returned PR_SUCCESS and hit the assertion. I'm adding bug 332348 as a dependency. It is likely the same bug. I'm not sure why it is being hit only when selfserv is in multi-process mode on NT, and not single-process.

Depends on: 332348

Comment 2

12 years ago
I tried adding a PR_SetSocketOption call in selfserv to change the socket to a blocking socket just before the PR_Close  call. Unfortunately, PR_Close still failed with error -5998 / PR_WOULD_BLOCK_ERROR . The OS error was 10035, EWOULDBLOCK .
The result reported in comment 2 doesn't surprise me. 

PR_SetSocketOption changes the semantics that NSPR presents to its callers,
not the setting of the underlying OS sockets.
The OS socket underlying NSPR is still non-blocking. 

The solution to this necessitates setting the underlying OS Socket to 
blocking mode.
You need to log in before you can comment on or make changes to this bug.