Re: [Cherokee] fcgi-0010: some fixes to the trunk

2005-12-11 Thread Alvaro Lopez Ortega

Mohammad DAMT wrote:

  * Put the managers into a one static table for all threads so it
  will not be re-created all the time.

   The idea is to allocate FastCGI managers per thread.  In this
   way, it is consistent (connections never change of thread) and we
   don't need semaphores to protect the static table.

 The problem is that the FastCGI server only accept one connection at
 a time. If the FCGI server is connected to a cherokee thread, then
 when the next new thread try to connect to it, then the new thread
 will be blocked. (However PHP supports multi connection)

 That is why if you succesfully load a fcgi page then do a refresh,
 the new session will be stalled because an empty manager table is
 re-created for that thread, then try to connect to a connected
 server.

  Damn it!!  I knew something like this would happen. :-/

  There is something that doesn't much sense though. The PHP server
  accepts multiple connection.. what for? :-?  I'm gonna take a look
  at the code to try to figure out that is the reason for that odd
  behaviour.

--
Greetings, alo.
http://www.alobbs.com
___
Cherokee mailing list
Cherokee@lists.alobbs.com
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee


Re: [Cherokee] fcgi-0010: some fixes to the trunk

2005-12-11 Thread Alvaro Lopez Ortega

Alvaro Lopez Ortega wrote:

   Damn it!!  I knew something like this would happen. :-/

   There is something that doesn't much sense though. The PHP server
   accepts multiple connection.. what for? :-?  I'm gonna take a look
   at the code to try to figure out that is the reason for that odd
   behaviour.

   I found where the problem is:

libfcgi/fcgiapp.c:

for (;;) {
/*
 * If a connection isn't open, accept a new connection (blocking).
 * If an OS error occurs in accepting the connection,
 * return -1 to the caller, who should exit.
 */
if (reqDataPtr-ipcFd  0) {
   [..]
reqDataPtr-ipcFd = OS_Accept([..]);
  [..]
   }

/*
 * A connection is open.  Read from the connection in order to
 * get the request's role and environment.  If protocol or other
 * errors occur, close the connection and try again.
 */
   [..]
}


  so, it seems like the libfcgi library has been written to only
  manage one connection per server..

--
Greetings, alo.
http://www.alobbs.com
___
Cherokee mailing list
Cherokee@lists.alobbs.com
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee