X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=libfcgi%2Ffcgio.cpp;h=5a54c1153c9dce8ad07412e23dc8c6729ecc44ca;hb=ac8d264a0023d0023d794f9644370a0f182c6037;hp=95e28ca74cdae6fd462c815a1dbafc2d7f3488ac;hpb=fdee298fbf8f873409f8552429a75017f70804bf;p=catagits%2Ffcgi2.git diff --git a/libfcgi/fcgio.cpp b/libfcgi/fcgio.cpp index 95e28ca..5a54c11 100644 --- a/libfcgi/fcgio.cpp +++ b/libfcgi/fcgio.cpp @@ -1,5 +1,5 @@ // -// $Id: fcgio.cpp,v 1.13 2002/02/24 20:12:22 robs Exp $ +// $Id: fcgio.cpp,v 1.14 2003/06/22 00:51:27 robs Exp $ // // Allows you communicate with FastCGI streams using C++ iostreams // @@ -91,12 +91,18 @@ int fcgi_streambuf::sync() // uflow() removes the char, underflow() doesn't int fcgi_streambuf::uflow() { - int rv = underflow(); - if (this->bufsize) gbump(1); - return rv; + if (this->bufsize) + { + int c = underflow(); + gbump(1); + return c; + } + else + { + return FCGX_GetChar(this->fcgx); + } } -// Note that the expected behaviour when there is no buffer varies int fcgi_streambuf::underflow() { if (this->bufsize) @@ -113,7 +119,7 @@ int fcgi_streambuf::underflow() } else { - return FCGX_GetChar(this->fcgx); + return FCGX_UnGetChar(FCGX_GetChar(this->fcgx), this->fcgx); } }