]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rollback: Windows port: cachemgr.cgi should use closesocket not close
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Jul 2008 10:42:57 +0000 (22:42 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Jul 2008 10:42:57 +0000 (22:42 +1200)
Squid-3 OS-specific portability code makes these obsolete.

tools/cachemgr.cc

index b96993004821149d14b4e79ba87ca09103cd9f89..04e226e58f5d7243574b810381a9a07dd6cd4851 100644 (file)
@@ -631,11 +631,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;
     }
 
@@ -777,13 +778,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;
@@ -874,11 +875,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);
 }