From: Amos Jeffries Date: Thu, 3 Jul 2008 05:07:35 +0000 (+1200) Subject: Windows port: cachemgr.cgi should use closesocket not close X-Git-Tag: SQUID_3_0_STABLE8~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=744d0c3406a86f6bba2d9ae7af7169c38b49f723;p=thirdparty%2Fsquid.git Windows port: cachemgr.cgi should use closesocket not close This bug was apparently fixed in 2.6 but not in 3.0. It only affects Windows builds. This brings Squid-3 cachemgr.cgi up to full Windows support parity with Squid-2 --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 611176b160..72c44ab332 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -636,12 +636,11 @@ read_reply(int s, cachemgr_request * req) #ifdef _SQUID_MSWIN_ perror(tmpfile); xfree(tmpfile); + closesocket(s); #else - perror("fdopen"); -#endif - close(s); +#endif return 1; } @@ -783,13 +782,13 @@ read_reply(int s, cachemgr_request * req) } } - fclose(fp); #ifdef _SQUID_MSWIN_ - + fclose(fp); remove(tmpfile); xfree(tmpfile); + closesocket(s); +#else close(s); - #endif return 0; @@ -874,7 +873,11 @@ process_request(cachemgr_request * req) req->hostname, req->action, make_auth_header(req)); +#ifdef _SQUID_MSWIN_ + send(s, buf, l, 0); +#else write(s, buf, l); +#endif debug(1) fprintf(stderr, "wrote request: '%s'\n", buf); return read_reply(s, req); }