/*
- * $Id: ipc_win32.cc,v 1.5 2007/12/14 23:11:47 amosjeffries Exp $
+ * $Id$
*
* DEBUG: section 54 Windows Interprocess Communication
* AUTHOR: Andrey Shorin <tolsty@tushino.com>
*
*/
-#include "squid.h"
+#include "squid-old.h"
#include "comm.h"
#include "fde.h"
+#include "ip/Address.h"
+#include "rfc1738.h"
#include "SquidTime.h"
#ifndef _MSWSOCK_
int type;
int crfd;
int cwfd;
- IpAddress local_addr;
+ Ip::Address local_addr;
struct addrinfo PS;
const char *prog;
char **args;
#if HAVE_PUTENV
char *env_str;
int tmp_s;
- env_str = (char *)xcalloc((tmp_s = strlen(Config.debugOptions) + 32), 1);
- snprintf(env_str, tmp_s, "SQUID_DEBUG=%s", Config.debugOptions);
+ env_str = (char *)xcalloc((tmp_s = strlen(Debug::debugOptions) + 32), 1);
+ snprintf(env_str, tmp_s, "SQUID_DEBUG=%s", Debug::debugOptions);
putenv(env_str);
#endif
}
pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, Ip::Address &local_addr, int *rfd, int *wfd, void **hIpc)
{
unsigned long thread;
DWORD ecode = 0;
pid_t pid;
- IpAddress tmp_addr;
+ Ip::Address tmp_addr;
struct addrinfo *aiCS = NULL;
struct addrinfo *aiPS = NULL;
return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
}
- /* NP: tmp_addr was left with eiether empty or aiCS in IpAddress format */
+ /* NP: tmp_addr was left with eiether empty or aiCS in Ip::Address format */
if (comm_connect_addr(pwfd, tmp_addr) == COMM_ERROR) {
CloseHandle((HANDLE) thread);
return ipcCloseAllFD(prfd, pwfd, -1, -1);
hello_buf[x] = '\0';
pid = atol(hello_buf);
- commSetTimeout(prfd, -1, NULL, NULL);
+ commUnsetFdTimeout(prfd);
commSetNonBlocking(prfd);
commSetNonBlocking(pwfd);
commSetCloseOnExec(prfd);
int prfd_ipc = -1, pwfd_ipc = -1, crfd_ipc = -1, cwfd_ipc = -1;
char *prog = NULL, *buf1 = NULL;
- IpAddress PS_ipc;
- IpAddress CS_ipc;
+ Ip::Address PS_ipc;
+ Ip::Address CS_ipc;
struct addrinfo *aiPS_ipc = NULL;
struct addrinfo *aiCS_ipc = NULL;
int cwfd = params->cwfd;
char **args = params->args;
- IpAddress PS = params->PS;
- IpAddress local_addr = params->local_addr;
+ Ip::Address PS = params->PS;
+ Ip::Address local_addr = params->local_addr;
buf1 = (char *)xcalloc(1, 8192);
strcpy(buf1, params->prog);
hProcess = pi.hProcess;
} else {
pid = -1;
- WIN32_maperror(GetLastError());
- x = errno;
+ x = GetLastError();
}
dup2(t1, 0);
else
thread_params.rfd = prfd_ipc;
- thread =
- (HANDLE) _beginthreadex(NULL, 0, ipc_thread_2, &thread_params, 0, NULL);
+ thread = (HANDLE)_beginthreadex(NULL, 0, ipc_thread_2, &thread_params, 0, NULL);
if (!thread) {
debugs(54, 0, "ipcCreate: CHILD: _beginthreadex: " << xstrerror());