From 4300768d65ba52d78fd0e68c7c4f35b254fbca65 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 3 Jul 2008 15:19:59 +1200 Subject: [PATCH] Windows port: cachemgr.cgi should use closesocket not close (few more) 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 --- tools/cachemgr.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index c3becac532..b969930048 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -777,13 +777,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 +874,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); } -- 2.47.3