]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed _SQUID_MSWIN_ to _SQUID_WINDOWS_ everywhere.\nExplicitly refer to Squid compa...
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 28 Jan 2012 17:04:47 +0000 (18:04 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 28 Jan 2012 17:04:47 +0000 (18:04 +0100)
src/comm.cc
src/fd.cc
src/ipc_win32.cc

index 6f048f375885d67c5d81da1c91a2e8b01a30a462..f7a4d71b745c2dfc65fdc5d256d922a1734799b4 100644 (file)
@@ -35,6 +35,7 @@
 #include "squid-old.h"
 #include "base/AsyncCall.h"
 #include "StoreIOBuffer.h"
+#include "compat/cmsg.h"
 #include "comm.h"
 #include "event.h"
 #include "fde.h"
@@ -346,7 +347,7 @@ comm_udp_recv(int fd, void *buf, size_t len, int flags)
 ssize_t
 comm_udp_send(int s, const void *buf, size_t len, int flags)
 {
-    return Squid::send(s, buf, len, flags);
+    return Squid::send(s, static_cast<const char *>(buf), len, flags);
 }
 
 
@@ -646,7 +647,7 @@ comm_apply_flags(int new_socket,
         commSetReuseAddr(new_socket);
 
     if (addr.GetPort() > (unsigned short) 0) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
         if (sock_type != SOCK_DGRAM)
 #endif
             commSetNoLinger(new_socket);
@@ -705,7 +706,7 @@ comm_import_opened(const Comm::ConnectionPointer &conn,
         fd_table[conn->fd].flags.close_on_exec = 1;
 
     if (conn->local.GetPort() > (unsigned short) 0) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
         if (AI->ai_socktype != SOCK_DGRAM)
 #endif
             fd_table[conn->fd].flags.nolinger = 1;
@@ -1304,7 +1305,7 @@ commSetTcpRcvbuf(int fd, int size)
 int
 commSetNonBlocking(int fd)
 {
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
     int flags;
     int dummy = 0;
 #endif
@@ -1324,9 +1325,9 @@ commSetNonBlocking(int fd)
     } else {
 #endif
 #endif
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 
-        if ((flags = Squid::fcntl(fd, F_GETFL, dummy)) < 0) {
+        if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
             debugs(50, 0, "FD " << fd << ": fcntl F_GETFL: " << xstrerror());
             return COMM_ERROR;
         }
@@ -1348,7 +1349,7 @@ commSetNonBlocking(int fd)
 int
 commUnsetNonBlocking(int fd)
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     int nonblocking = FALSE;
 
     if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) {
@@ -1823,7 +1824,7 @@ void CommIO::Initialise()
 {
     /* Initialize done pipe signal */
     int DonePipe[2];
-    if (pipe(DonePipe)) {}
+    if (Squid::pipe(DonePipe)) {}
     DoneFD = DonePipe[1];
     DoneReadFD = DonePipe[0];
     fd_open(DoneReadFD, FD_PIPE, "async-io completetion event: main");
index 215dafb5c88f30db47d2328e8f31ffabb765e1b2..76579a4f63ff408109b7a9f67e4bcac6686e35ae 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -49,7 +49,7 @@
 
 int default_read_method(int, char *, int);
 int default_write_method(int, const char *, int);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 int socket_read_method(int, char *, int);
 int socket_write_method(int, const char *, int);
 int file_read_method(int, char *, int);
@@ -122,7 +122,7 @@ fd_close(int fd)
     *F = fde();
 }
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
 int
 socket_read_method(int fd, char *buf, int len)
@@ -149,7 +149,7 @@ socket_write_method(int fd, const char *buf, int len)
 {
     int i;
     PROF_start(send);
-    i = send(fd, (const void *) buf, len, 0);
+    i = Squid::send(fd, buf, len, 0);
     PROF_stop(send);
     return i;
 }
@@ -222,7 +222,7 @@ fd_open(int fd, unsigned int type, const char *desc)
     F->type = type;
     F->flags.open = 1;
     F->epoll_state = 0;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     F->win32.handle = _get_osfhandle(fd);
 
index 5b808d430a3459c9c38a41db63f246bf802e4c0c..8b95407c59ab83b59543a05f8bf4098cf8f408fe 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "squid-old.h"
 #include "comm.h"
+#include "comm/Connection.h" /* for COMM_* */
 #include "fde.h"
 #include "ip/Address.h"
 #include "rfc1738.h"
@@ -276,7 +277,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name
         return ipcCloseAllFD(prfd, pwfd, -1, -1);
     }
 
-    x = send(pwfd, (const void *)ok_string, strlen(ok_string), 0);
+    x = Squid::send(pwfd, ok_string, strlen(ok_string), 0);
 
     if (x < 0) {
         debugs(54, 0, "ipcCreate: PARENT: OK write test failed");
@@ -350,7 +351,7 @@ ipcSend(int cwfd, const char *buf, int len)
 {
     int x;
 
-    x = send(cwfd, (const void *)buf, len, 0);
+    x = Squid::send(cwfd, buf, len, 0);
 
     if (x < 0) {
         debugs(54, 0, "sendto FD " << cwfd << ": " << xstrerror());
@@ -424,7 +425,7 @@ ipc_thread_1(void *in_params)
             goto cleanup;
     }
 
-    x = send(cwfd, (const void *)hello_string, strlen(hello_string) + 1, 0);
+    x = Squid::send(cwfd, hello_string, strlen(hello_string) + 1, 0);
 
     if (x < 0) {
         debugs(54, 0, "sendto FD " << cwfd << ": " << xstrerror());
@@ -660,7 +661,7 @@ ipc_thread_1(void *in_params)
             goto cleanup;
         }
 
-        x = send(pwfd_ipc, (const void *)ok_string, strlen(ok_string), 0);
+        x = Squid::send(pwfd_ipc, ok_string, strlen(ok_string), 0);
         x = recv(prfd_ipc, (void *)(buf1 + 200), 8191 - 200, 0);
         assert((size_t) x == strlen(ok_string)
                && !strncmp(ok_string, buf1 + 200, strlen(ok_string)));
@@ -729,7 +730,7 @@ ipc_thread_1(void *in_params)
         if (type == IPC_TCP_SOCKET)
             x = write(c2p[1], buf1, x);
         else
-            x = send(pwfd_ipc, (const void *)buf1, x, 0);
+            x = Squid::send(pwfd_ipc, buf1, x, 0);
 
         if (x <= 0) {
             debugs(54, 3, "ipc(" << prog << "," << pid << "): " << x << " bytes written to " << prog << ". Exiting...");
@@ -749,7 +750,7 @@ cleanup:
         ipcCloseAllFD(-1, -1, crfd, cwfd);
 
     if (prfd_ipc != -1) {
-        send(crfd_ipc, (const void *)shutdown_string, strlen(shutdown_string), 0);
+        Squid::send(crfd_ipc, shutdown_string, strlen(shutdown_string), 0);
         shutdown(crfd_ipc, SD_BOTH);
         shutdown(prfd_ipc, SD_BOTH);
     }
@@ -838,7 +839,7 @@ ipc_thread_2(void *in_params)
 
         debugs(54, 5, "ipc(" << prog << "," << pid << "): received from child : " << rfc1738_escape_unescaped(buf2));
 
-        x = send(send_fd, (const void *)buf2, x, 0);
+        x = Squid::send(send_fd, buf2, x, 0);
 
         if ((x <= 0 && type == IPC_TCP_SOCKET) ||
                 (x < 0 && type == IPC_UDP_SOCKET)) {