@ -2409,7 +2409,6 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
# if !defined(_WIN32) && !defined(__CYGWIN__)
if ( ioctl ( hctx - > fd , FIONREAD , & toread ) ) {
if ( errno = = EAGAIN ) {
fdevent_event_add ( srv - > ev , & ( hctx - > fde_ndx ) , hctx - > fd , FDEVENT_IN ) ;
return 0 ;
}
log_error_write ( srv , __FILE__ , __LINE__ , " sd " ,
@ -2442,7 +2441,6 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
if ( - 1 = = r ) {
if ( errno = = EAGAIN ) {
fdevent_event_add ( srv - > ev , & ( hctx - > fde_ndx ) , hctx - > fd , FDEVENT_IN ) ;
return 0 ;
}
log_error_write ( srv , __FILE__ , __LINE__ , " sds " ,
@ -2452,6 +2450,7 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
}
}
if ( 0 = = r ) {
if ( ! ( fdevent_event_get_interest ( srv - > ev , hctx - > fd ) & FDEVENT_IN ) ) return 0 ;
log_error_write ( srv , __FILE__ , __LINE__ , " ssdsb " ,
" unexpected end-of-file (perhaps the fastcgi process died): " ,
" pid: " , proc - > pid ,
@ -2966,9 +2965,10 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subrequest) {
if ( chunkqueue_length ( con - > write_queue ) > 65536 - 4096 ) {
fdevent_event_clr ( srv - > ev , & ( hctx - > fde_ndx ) , hctx - > fd , FDEVENT_IN ) ;
} else if ( ! ( fdevent_event_get_interest ( srv - > ev , hctx - > fd ) & FDEVENT_IN ) ) {
/* optimistic read from backend , which might re-enable FDEVENT_IN */
/* optimistic read from backend */
handler_t rc = fcgi_recv_response ( srv , hctx ) ; /*(might invalidate hctx)*/
if ( rc ! = HANDLER_GO_ON ) return rc ; /*(unless HANDLER_GO_ON)*/
fdevent_event_add ( srv - > ev , & ( hctx - > fde_ndx ) , hctx - > fd , FDEVENT_IN ) ;
}
}