From: Amos Jeffries Date: Fri, 4 Jul 2008 11:10:23 +0000 (+1200) Subject: Rollback: Windows port: cachemgr.cgi should use closesocket not close X-Git-Tag: SQUID_3_0_STABLE8~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d9c2ac41db0183b02450148b424e223287017d9;p=thirdparty%2Fsquid.git Rollback: Windows port: cachemgr.cgi should use closesocket not close Squid-3 OS-specific portability code makes these obsolete. --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 72c44ab332..611176b160 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -636,11 +636,12 @@ read_reply(int s, cachemgr_request * req) #ifdef _SQUID_MSWIN_ perror(tmpfile); xfree(tmpfile); - closesocket(s); #else + perror("fdopen"); - close(s); #endif + + close(s); return 1; } @@ -782,13 +783,13 @@ read_reply(int s, cachemgr_request * req) } } -#ifdef _SQUID_MSWIN_ fclose(fp); +#ifdef _SQUID_MSWIN_ + remove(tmpfile); xfree(tmpfile); - closesocket(s); -#else close(s); + #endif return 0; @@ -873,11 +874,7 @@ 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); }