Can it be that if accept is called when there is no incoming request something screwed up in the process so subsequent accepts even in other threads do not work?

Looks like OpenBSD may not allow to call extra accept

Michael A. Cleverly wrote:
My adventures (with CVS HEAD) on OpenBSD/sparc64 continue.

Unless I set:

    ns_section      "ns/server/${servername}/module/nssock"
    ns_param       acceptsize          1

in my conf file then incoming an HTTP request never get serviced
promptly; I can't connect to the nscp control port, and I can't hit
CTRL-C to end the (foreground) nsd process.

If I set ns_param acceptsize to 2 then the first connection "hangs",
when a second one is made both are processed immediately.

The default acceptsize is equal to the backlog setting, which defaults
to 256.  I strongly suspect (but haven't had the patience to confirm)
that with no acceptsize setting I'd have to have 256 active HTTP
connections before any would be processed at all.

I've sprinkled driver.c, binder.c, and sock.c with caveman debugging
Ns_Log() calls and it appears to block in the while loop attempting to
accept more when calling the final check of the four checks [in
DriverThread() in driver.c at line 1272]:

     (sockPtr = SockAccept(drvPtr)) != NULL

which seems to end up waiting  [in SockAccept() in driver.c at line 1635-6] on:

        sockPtr->sock = Ns_SockAccept(drvPtr->sock,
                                      (struct sockaddr *) &sockPtr->sa, &slen);

which in turn waits [in Ns_SockAccept() in sock.c at line 420] on:

    sock = accept(lsock, saPtr, (socklen_t *) lenPtr);

which makes me think that the listening socket must not be set in
non-blocking mode(?).

Suggestions? The same behavior does not occur on OpenBSD 3.8/macppc or
OpenBSD 3.9/amd64. (Everything works "out-of-the-box" as expected.)

Michael

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel



--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/

Reply via email to