*
*/
#ifndef lint
-static const char rcsid[] = "$Id: fcgiapp.c,v 1.33 2001/12/12 14:12:26 robs Exp $";
+static const char rcsid[] = "$Id: fcgiapp.c,v 1.34 2001/12/12 22:54:10 robs Exp $";
#endif /* not lint */
#include <assert.h>
*/
int FCGX_GetChar(FCGX_Stream *stream)
{
- if(stream->rdNext != stream->stop)
- return *stream->rdNext++;
- if(stream->isClosed || !stream->isReader)
+ if (stream->isClosed || ! stream->isReader)
return EOF;
+
+ if (stream->rdNext != stream->stop)
+ return *stream->rdNext++;
+
stream->fillBuffProc(stream);
if (stream->isClosed)
return EOF;
+
stream->stopUnget = stream->rdNext;
- if(stream->rdNext != stream->stop)
+ if (stream->rdNext != stream->stop)
return *stream->rdNext++;
+
ASSERT(stream->isClosed); /* bug in fillBufProc if not */
return EOF;
}
{
int m, bytesMoved;
- if(n <= 0) {
+ if (stream->isClosed || ! stream->isReader || n <= 0) {
return 0;
}
/*
*/
if(stream->FCGI_errno == 0) {
stream->FCGI_errno = FCGI_errno;
- stream->isClosed = TRUE;
}
+
+ stream->isClosed = TRUE;
}
/*