
06-28-2004, 07:30 PM
|
|
Member
|
|
Join Date: Jun 2004
Location: Wellington, NZ
Posts: 13
|
|
Quote:
|
Originally Posted by mistwang
I think your fast CGI responder does not fully comply with fast CGI specification. LSWS buffers response until "FCGI_END_REQUEST" packet is received for such a small response body. I believe, LSWS does not receive "FCGI_END_REQUEST" in your case.
In order to help debuging the problem, you can turn on LSWS debug log by setting debug level to "HIGH" from the web admin interface.
What language is being used? Are you using any Fast CGI SDK or implementing the Fast CGI protocol stack yourself?
|
Thanks for your response. As detailed in http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S5.5, FCGI_END_REQUEST should only be used at the end of the response. As the response consists of multiple parts (with a second or two delay between each one), there is only one logical request to the FCGI communications layer.
Apache handles this by turning off buffering if the script issues a complete HTTP compliant header (including the response code line) - see http://httpd.apache.org/docs/misc/FA...ml#nph-scripts.
FYI, I'm using Perl's FCGI module.
Code:
2004-06-29 14:27:16.117 [DEBUG] [192.168.1.30:40428-1] Keep-alive timeout, close!
2004-06-29 14:27:16.117 [DEBUG] [192.168.1.30:40428-1] Close socket ...
2004-06-29 14:27:18.716 [DEBUG] [*:80] New connection from 192.168.1.30:40430.
2004-06-29 14:27:18.716 [DEBUG] [*:80] 1 connections accepted!
2004-06-29 14:27:21.875 [DEBUG] [192.168.1.30:40430-0] HttpIOLink::handleEvents() events=1!
2004-06-29 14:27:21.875 [DEBUG] [192.168.1.30:40430-0] HttpConnection::onReadEx()!
2004-06-29 14:27:21.875 [DEBUG] [192.168.1.30:40430-0] Read from client: 46
2004-06-29 14:27:21.875 [DEBUG] [192.168.1.30:40430-0] HttpIOLink::handleEvents() events=1!
2004-06-29 14:27:21.875 [DEBUG] [192.168.1.30:40430-0] HttpConnection::onReadEx()!
2004-06-29 14:27:21.875 [DEBUG] [192.168.1.30:40430-0] Read from client: 89
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0] New request:
Method=[GET], URI=[/fozzie-dev/test/server-push.pl],
QueryString=[]
Content Length=0
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0] HttpIOLink::suspendRead()...
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0] run fcgi processor.
2004-06-29 14:27:21.876 [DEBUG] [UDS://mv/app/dev/fozzie/var/appSocket] connection available!
2004-06-29 14:27:21.876 [DEBUG] [UDS://mv/app/dev/fozzie/var/appSocket] new request [192.168.1.30:40430-0:fcgi] is assigned with connection!
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::doWrite()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::beginRequest()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::pendingWrite(),m_iCurStreamHeader=16
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] request header is done
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::beginReqBody()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::pendingEndStream()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] ExtConn::continueRead()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] Request body done!
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::endOfReqBody()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::pendingEndStream()
2004-06-29 14:27:21.876 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::flush()
2004-06-29 14:27:21.880 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::suspendWrite()
... here is where it sits until the last chunk is sent from the application ...
Code:
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] ExtConn::onRead()
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] FcgiConnection::doRead()
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] read 560 bytes from Fast CGI.
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] FCGI Header: 01060001020c0400
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] process STDOUT 524 bytes
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] response header finished!
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] FCGI Header: 0106000100000000
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] FCGI Header: 0103000100080000
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] [EXT] EndResponse( endCode=0, protocolStatus=0 )
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] call pConn->writeRespBody() to write 318 bytes
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] Written to client: 548
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] pConn->writeRespBody() return 318
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] ReqBody: 0, RespBody: 318, HEC_COMPLETE!
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] m_pHandler->onWrite() return 0
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] HttpConnection::flush()!
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] HttpConnection::nextRequest()!
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-0:fcgi] HttpExtConnector::cleanUp() ...
2004-06-29 14:27:27.919 [DEBUG] [192.168.1.30:40430-1] release ExtProcessor!
2004-06-29 14:27:27.919 [DEBUG] [UDS://mv/app/dev/fozzie/var/appSocket] add recycled connection to connection pool!
2004-06-29 14:27:32.144 [DEBUG] [192.168.1.30:40430-1] Keep-alive timeout, close!
2004-06-29 14:27:32.144 [DEBUG] [192.168.1.30:40430-1] Close socket ...
|