durusmail: quixote-users: detecting when quixote is not running as part of a fcgi process
detecting when quixote is not running as part of a fcgi process
2001-10-12
2001-10-15
detecting when quixote is not running as part of a fcgi process
dan hitt
2001-10-12
Hi,

We're running quixote as part of a non-fcgi cgi program under apache,
at least for now, and at least for development.

But the _startup() routine in fcgi.py doesn't detect this.

Its test for non-fcgi is that the call
   socket.fromfd(sys.stdin.fileno(),socket.AF_INET,socket.SOCK_STREAM)
raises an exception for which the err is not errno.ENOTCONN.

But on our system (NetBSD 1.5, apache 1.3.20, quixote 0.3 and quixote 0.4)
the socket.fromfd(...) raises an exception and err is really and truly
errno.ENOTCONN.

There's of course an easy work-around to manually set _isFCGI to 0
and prematurely return from _startup().

But since quixote is going through new versions, i reckon that
i should try to understand the _startup() code and use it
correctly so i don't have to modify each quixote coming
down the pike (and also because sooner or later we'll
probably experiment with using fcgi to see the improvement,
etc).

Any advice?

dan



reply