From fb0f73bb44ced396286d2d1fbd60572bb4ffc889 Mon Sep 17 00:00:00 2001 From: robs Date: Mon, 26 Nov 2001 18:08:25 +0000 Subject: [PATCH] use gcount() instead of eof() because ignore() doesn't set the eof bit in some versions of glibc++ --- examples/echo-cpp.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/echo-cpp.cpp b/examples/echo-cpp.cpp index a95b685..bafa5e9 100644 --- a/examples/echo-cpp.cpp +++ b/examples/echo-cpp.cpp @@ -1,7 +1,7 @@ /* * A simple FastCGI application example in C++. * - * $Id: echo-cpp.cpp,v 1.5 2001/11/21 21:15:36 robs Exp $ + * $Id: echo-cpp.cpp,v 1.6 2001/11/26 18:08:25 robs Exp $ * * Copyright (c) 2001 Rob Saccoccio and Chelsea Networks * All rights reserved. @@ -80,9 +80,12 @@ static long gstdin(FCGX_Request * request, char ** content) cin.read(*content, clen); clen = cin.gcount(); - // chew up any remaining stdin - this shouldn't be necessary - // but is because mod_fastcgi doesn't handle it correctly - do cin.ignore(1024); while (! cin.eof()); + // Chew up any remaining stdin - this shouldn't be necessary + // but is because mod_fastcgi doesn't handle it correctly. + // + // ignore() doesn't set the eof bit in some versions of glibc++ + // so use gcount() instead of eof()... + do cin.ignore(1024); while (cin.gcount() == 1024); return clen; } -- 2.11.4.GIT