Created
November 5, 2009 21:54
-
-
Save finn/227447 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int fcgi_demux_response(server *srv, handler_ctx *hctx) { | |
/* ... */ | |
int toread; | |
/* ... */ | |
/* | |
* check how much we have to read | |
*/ | |
if (ioctl(hctx->fd, FIONREAD, &toread)) { | |
/* we never get here */ | |
/* NOTE: hctx->fd is the fd to the fastcgi process */ | |
/* NOTE: FIONREAD "Get the number of bytes that are immediately available for reading." */ | |
/* NOTE: toread is where the number of bytes is placed */ | |
} | |
/* ... */ | |
/* init read-buffer */ | |
if (toread > 0) { | |
/* we never get here */ | |
} else { | |
/* this is where the error occurs. toread is not greater than zero */ | |
log_error_write(srv, __FILE__, __LINE__, "ssdsb", | |
"unexpected end-of-file (perhaps the fastcgi process died):", | |
"pid:", proc->pid, | |
"socket:", proc->connection_name); | |
return -1; | |
} | |
/* rest of the function is irrelevant since it returned already */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment