From: robertc <> Date: Mon, 11 Aug 2003 19:07:56 +0000 (+0000) Subject: Summary: Cachemgr page length - Guido. X-Git-Tag: SQUID_3_0_PRE3~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad1fa9c95c755256a0757b8e4644554be559057d;p=thirdparty%2Fsquid.git Summary: Cachemgr page length - Guido. Keywords: Hi, On Windows native port, cachemgr parses the squid output in TEXT mode, with a wrong resultant Content-Length in html pages, see this thread for details: http://www1.it.squid-cache.org/mail-archive/squid-dev/200306/0044.html The attached patch force cachemgr to work only on BINARY mode and contents a cosmetic change. Regards Guido --- diff --git a/src/cachemgr.cc b/src/cachemgr.cc index 1d9bd89e74..87e12decf2 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.104 2003/02/21 22:50:07 robertc Exp $ + * $Id: cachemgr.cc,v 1.105 2003/08/11 13:07:56 robertc Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -542,8 +542,9 @@ read_reply(int s, cachemgr_request * req) } #ifdef _SQUID_MSWIN_ - while ((reply=recv(s,buf,sizeof(buf),0))>0) - fwrite(buf,1,reply,fp); + + while ((reply=recv(s, buf , sizeof(buf), 0)) > 0) + fwrite(buf, 1, reply, fp); rewind(fp); @@ -771,6 +772,10 @@ main(int argc, char *argv[]) Win32SockInit(); + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); + _fmode = _O_BINARY; + if ((s = strrchr(argv[0], '\\'))) #else