]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Cachemgr page length - Guido.
authorrobertc <>
Mon, 11 Aug 2003 19:07:56 +0000 (19:07 +0000)
committerrobertc <>
Mon, 11 Aug 2003 19:07:56 +0000 (19:07 +0000)
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

src/cachemgr.cc

index 1d9bd89e74d1e94b22edcd6626d57a6d377bbcde..87e12decf234f864cc4ce07af3b1a837e6525e5f 100644 (file)
@@ -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