#include <inttypes.h>
#endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#undef IN_ADDR
#include <ws2tcpip.h>
#endif
/* The following code section is part of an EXPERIMENTAL native */
/* Windows NT/2000 Squid port - Compiles only on MS Visual C++ or MinGW */
-#if _SQUID_MSWIN_ || _SQUID_MINGW_
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#undef strerror
#define sys_nerr _sys_nerr
#define _SQUID_WINDOWS_ 1
#elif defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32)
-/* We are using _SQUID_MSWIN_ define in cf.data.pre, so
- it must be defined to 1 to avoid the build failure of cfgen.
- */
-#define _SQUID_MSWIN_ 1
#define _SQUID_WINDOWS_ 1
#elif defined(__APPLE__)
* "%lx" instead of "%llx"
*/
#ifndef PRId64
-#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */
+#if _SQUID_WINDOWS_
#define PRId64 "I64d"
#elif SIZEOF_INT64_T > SIZEOF_LONG
#define PRId64 "lld"
#endif
#ifndef PRIu64
-#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */
+#if _SQUID_WINDOWS_
#define PRIu64 "I64u"
#elif SIZEOF_INT64_T > SIZEOF_LONG
#define PRIu64 "llu"
#endif
#ifndef PRIX64
-#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */
+#if _SQUID_WINDOWS_
#define PRIX64 "I64X"
#elif SIZEOF_INT64_T > SIZEOF_LONG
#define PRIX64 "llX"
inttypes.h \
db.h \
db_185.h \
- wchar.h
+ wchar.h \
+ ws2tcpip.h
)
CHECK_STRUCT_PAM_CONV
#include <string.h>
#include <ctype.h>
-#if _SQUID_MSWIN_ /* Native Windows port and MinGW */
-
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#define snprintf _snprintf
#include <windows.h>
#include <winldap.h>
/* On Windows ldap_start_tls_s is available starting from Windows XP,
* so we need to bind at run-time with the function entry point
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (use_tls) {
HMODULE WLDAP32Handle;
char progname[] = "basic_radius_auth";
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
void
Win32SockCleanup(void)
{
fprintf(stderr, "FATAL: %s: Shared secret not specified\n", argv[0]);
exit(1);
}
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
{
WSADATA wsaData;
WSAStartup(2, &wsaData);
debug(char *format,...)
{
#ifdef DEBUG
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (debug_enabled) {
va_list args;
vfprintf(stderr, format, args);
va_end(args);
}
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
#endif /* DEBUG */
}
#endif /* __GNUC__ */
#include "ldap_backend.h"
-#if _SQUID_MSWIN_ /* Native Windows port and MinGW */
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#define snprintf _snprintf
#include <windows.h>
/* On Windows ldap_start_tls_s is available starting from Windows XP,
* so we need to bind at run-time with the function entry point
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (use_tls) {
HMODULE WLDAP32Handle;
#include "digest_common.h"
-#if _SQUID_MSWIN_ /* Native Windows port and MinGW */
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#define snprintf _snprintf
#include <windows.h>
#include "ldap_backend.h"
-#if _SQUID_MSWIN_ /* Native Windows port and MinGW */
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#define snprintf _snprintf
#include <windows.h>
/* On Windows ldap_start_tls_s is available starting from Windows XP,
* so we need to bind at run-time with the function entry point
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (use_tls) {
HMODULE WLDAP32Handle;
#include <ctype.h>
#endif
-#if _SQUID_MSWIN_ /* Native Windows port and MinGW */
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#define snprintf _snprintf
#include <windows.h>
/* On Windows ldap_start_tls_s is available starting from Windows XP,
* so we need to bind at run-time with the function entry point
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (use_tls) {
HMODULE WLDAP32Handle;
#define SQUID_MAXPATHLEN 256
// TODO: determine if this is required. OR if compat/os/mswin.h works
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
/** \cond AUTODOCS-IGNORE */
using namespace Squid;
/** \endcond */
/* Windows Port */
/* win32lib.c */
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
SQUIDCEXTERN int chroot (const char *);
#if !HAVE_GETTIMEOFDAY
SQUIDCEXTERN int gettimeofday(struct timeval * ,void *);
#include "squid.h"
/* The following code section is part of the native Windows Squid port */
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#include "util.h"
#include <stdlib.h>
while ((dirp->dd_stat < lPos) && readdir(dirp));
}
}
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
typedef int64_t off64_t;
#endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
union sigval {
int sival_int; /* integer value */
int aio_open(const char *, int);
void aio_close(int);
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
#endif /* USE_DISKIO_AIO */
#endif /* __WIN32_AIO_H__ */
#include "protos.h"
#include "squid_windows.h"
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#ifndef _MSWSOCK_
#include <mswsock.h>
#endif
DOC_END
NAME: windows_ipaddrchangemonitor
-IFDEF: _SQUID_MSWIN_
+IFDEF: _SQUID_WINDOWS_
COMMENT: on|off
TYPE: onoff
DEFAULT: on
define["USE_WCCP"]="--enable-wccp"
define["USE_WCCPv2"]="--enable-wccpv2"
define["USE_QOS_TOS"]="--enable-zph-qos"
- define["_SQUID_MSWIN_"]="MS Windows"
+ define["_SQUID_WINDOWS_"]="MS Windows"
define["SO_MARK&&USE_LIBCAP"]="Packet MARK (Linux)"
}
/^IFDEF:/ {
commSetReuseAddr(new_socket);
if (addr.GetPort() > (unsigned short) 0) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (sock_type != SOCK_DGRAM)
#endif
commSetNoLinger(new_socket);
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;
int
commSetNonBlocking(int fd)
{
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
int flags;
int dummy = 0;
#endif
} else {
#endif
#endif
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
debugs(50, 0, "FD " << fd << ": fcntl F_GETFL: " << xstrerror());
int
commUnsetNonBlocking(int fd)
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
int nonblocking = FALSE;
if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) {
* This is a per-port limit for ICP/HTCP ports.
* DNS has a separate limit.
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#define INCOMING_UDP_MAX 1
#else
#define INCOMING_UDP_MAX 15
/**
* Max number of DNS messages to receive per call to DNS read handler
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#define INCOMING_DNS_MAX 1
#else
#define INCOMING_DNS_MAX 15
* Max number of new TCP connections to accept per call to the TCP listener poller.
* This is a per-port limit for HTTP/HTTPS ports.
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#define INCOMING_TCP_MAX 1
#else
#define INCOMING_TCP_MAX 10
static void _db_print_stderr(const char *format, va_list args);
static void _db_print_file(const char *format, va_list args);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
extern LPCRITICAL_SECTION dbg_mutex;
typedef BOOL (WINAPI * PFInitializeCriticalSectionAndSpinCount) (LPCRITICAL_SECTION, DWORD);
#endif
va_list args2;
va_list args3;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
/* Multiple WIN32 threads may call this simultaneously */
if (!dbg_mutex) {
_db_print_syslog(format, args3);
#endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
LeaveCriticalSection(dbg_mutex);
#endif
--i;
snprintf(from, MAXPATHLEN, "%s.%d", debug_log_file, i - 1);
snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, i);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
remove
(to);
#endif
* You can't rename open files on Microsoft "operating systems"
* so we close before renaming.
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (debug_log != stderr)
fclose(debug_log);
#endif
/* Rotate the current log to .0 */
if (Debug::rotateNumber > 0) {
snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, 0);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
remove
(to);
#endif
static void idnsFreeNameservers(void);
static void idnsFreeSearchpath(void);
static void idnsParseNameservers(void);
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
static void idnsParseResolvConf(void);
#endif
#if _SQUID_WINDOWS_
}
}
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
static void
idnsParseResolvConf(void)
{
assert(0 == nns);
idnsParseNameservers();
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
if (0 == nns)
idnsParseResolvConf();
}
}
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
{
WSADATA wsaData;
memset(request, '\0', REQ_SZ);
if (fgets(request, REQ_SZ, stdin) == NULL) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
WSACleanup();
#endif
exit(1);
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);
*F = fde();
}
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
int
socket_read_method(int fd, char *buf, int len)
F->type = type;
F->flags.open = 1;
F->epoll_state = 0;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
F->win32.handle = _get_osfhandle(fd);
if (!flags.open)
return;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
storeAppendPrintf(&dumpEntry, "%4d 0x%-8lX %-6.6s %4d %7" PRId64 "%c %7" PRId64 "%c %-21s %s\n",
fdNumber,
{
int i;
storeAppendPrintf(dumpEntry, "Active file descriptors:\n");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
storeAppendPrintf(dumpEntry, "%-4s %-10s %-6s %-4s %-7s* %-7s* %-21s %s\n",
"File",
"Nwrite",
"Remote Address",
"Description");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
storeAppendPrintf(dumpEntry, "---- ---------- ------ ---- -------- -------- --------------------- ------------------------------\n");
#else
storeAppendPrintf(dumpEntry, "---- ------ ---- -------- -------- --------------------- ------------------------------\n");
SSL *ssl;
SSL_CTX *dynamicSslContext; ///< cached and then freed when fd is closed
#endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
struct {
long handle;
} win32;
ssl = NULL;
dynamicSslContext = NULL;
#endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
win32.handle = NULL;
#endif
tosFromServer = '\0';
if (::stat(path, &swap_sb) < 0) {
debugs (47, 2, "COSS swap space space being allocated.");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
mkdir(path);
#else
fatalf("Swap directory %s is not a directory.", aPath);
}
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
} else if (0 == mkdir(aPath)) {
#else
if (dir_pointer == NULL) {
if (errno == ENOENT) {
debugs(36, DBG_CRITICAL, HERE << "WARNING: Creating " << p1);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (mkdir(p1) == 0)
#else
extern int64_t store_maxobjsize; /* -1 */
extern hash_table *proxy_auth_username_cache; /* NULL */
extern int incoming_sockets_accepted;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
extern unsigned int WIN32_Socks_initialized; /* 0 */
#endif
#if _SQUID_WINDOWS_
void
HelperServerBase::closePipesSafely()
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
int no = index + 1;
shutdown(writePipe->fd, SD_BOTH);
readPipe->close();
writePipe->close();
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (hIpc) {
if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) {
getCurrentTime();
void
HelperServerBase::closeWritePipeSafely()
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
int no = index + 1;
shutdown(writePipe->fd, (readPipe->fd == writePipe->fd ? SD_BOTH : SD_SEND));
readPipe->fd = -1;
writePipe->close();
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (hIpc) {
if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) {
getCurrentTime();
#if _SQUID_WINDOWS_
#include "fde.h"
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#if HAVE_WINSOCK2_H
#include <winsock2.h>
uint32_t timestamp; /* not part of ICMP, but we need it */
} icmphdr;
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
#ifndef ICMP_ECHO
#define ICMP_ECHO 8
Close();
}
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
void
Win32SockCleanup(void)
{
int
IcmpPinger::Open(void)
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
WSADATA wsaData;
WSAPROTOCOL_INFO wpi;
return icmp_sock;
-#else /* !_SQUID_MSWIN_ */
+#else /* !_SQUID_WINDOWS_ */
/* non-windows apps use stdin/out pipes as the squid channel(s) */
socket_from_squid = 0; // use STDIN macro ??
void
IcmpPinger::Close(void)
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
shutdown(icmp_sock, SD_BOTH);
close(icmp_sock);
if (localhost.SetIPv4())
SendEcho(localhost, S_ICMP_ECHO, "localhost");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
debugs(37, 4, HERE << "Pinger handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid);
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
return icmp_sock;
#else /* USE_ICMP */
return -1;
debugs(37, DBG_IMPORTANT, HERE << "Closing Pinger socket on FD " << icmp_sock);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
send(icmp_sock, (const void *) "$shutdown\n", 10, 0);
comm_close(icmp_sock);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (hIpc) {
if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) {
#include "Icmp6.h"
#include "IcmpPinger.h"
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#if HAVE_WINSOCK2_H
#include <winsock2.h>
/* non-windows use STDOUT for feedback to squid */
#define LINK_TO_SQUID 1
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
// ICMP Engines are declared global here so they can call each other easily.
IcmpPinger control;
#if HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
-#if _SQUID_MSWIN_
+#if HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#if HAVE_NETDB_H
static void mainSetCwd(void);
static int checkRunningPid(void);
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
static const char *squid_start_script = "squid_start";
#endif
{
do_rotate = 1;
RotateSignal = sig;
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
#if !HAVE_SIGACTION
signal(sig, rotate_logs);
{
do_reconfigure = 1;
ReconfigureSignal = sig;
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
#if !HAVE_SIGACTION
signal(sig, reconfigure);
" pid " << ppid << ": " << xstrerror());
}
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
#if KILL_PARENT_OPT
if (!IamMasterProcess() && ppid > 1) {
setSystemLimits();
debugs(1, DBG_IMPORTANT, "With " << Squid_MaxFD << " file descriptors available");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
debugs(1, DBG_IMPORTANT, "With " << _getmaxstdio() << " CRT stdio descriptors available");
exit(0);
}
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
/*
* This function is run when Squid is in daemon mode, just
* before the parent forks and starts up the child process.
}
}
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
static int
checkRunningPid(void)
static void
watch_child(char *argv[])
{
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
char *prog;
#if _SQUID_NEXT_
}
/* NOTREACHED */
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
}
Ssl::Lock::Lock(std::string const &aFilename) :
filename(aFilename),
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
hFile(INVALID_HANDLE_VALUE)
#else
fd(-1)
bool Ssl::Lock::locked() const
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
return hFile != INVALID_HANDLE_VALUE;
#else
return fd != -1;
void Ssl::Lock::lock()
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
hFile = CreateFile(TEXT(filename.c_str()), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
#else
#endif
throw std::runtime_error("Failed to open file " + filename);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (!LockFile(hFile, 0, 0, 1, 0))
#else
if (flock(fd, LOCK_EX) != 0)
void Ssl::Lock::unlock()
{
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (hFile != INVALID_HANDLE_VALUE) {
UnlockFile(hFile, 0, 0, 1, 0);
CloseHandle(hFile);
const char *name() const { return filename.c_str(); }
private:
std::string filename;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
HANDLE hFile; ///< Windows file handle.
#else
int fd; ///< Linux file descriptor.
bool setClientSNI(SSL *ssl, const char *fqdn);
} //namespace Ssl
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#if defined(__cplusplus)
#endif /* __cplusplus */
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
#endif /* SQUID_SSL_SUPPORT_H */
* The following is a workaround for create store directories sequentially
* when running on native Windows port.
*/
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
if (fork())
return;
aStore.create();
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
exit(0);
{
swapDir->create();
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
pid_t pid;
#endif
#endif /* PRINT_STACK_TRACE */
-#if SA_RESETHAND == 0 && !_SQUID_MSWIN_
+#if SA_RESETHAND == 0 && !_SQUID_WINDOWS_
signal(SIGSEGV, SIG_DFL);
signal(SIGBUS, SIG_DFL);
void
sig_child(int sig)
{
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
#if _SQUID_NEXT_
union wait status;
#else
debugs(50, DBG_CRITICAL, "sigaction: sig=" << sig << " func=" << func << ": " << xstrerror());
#else
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
/*
On Windows, only SIGINT, SIGILL, SIGFPE, SIGTERM, SIGBREAK, SIGABRT and SIGSEGV signals
are supported, so we must care of don't call signal() for other value.
void
unlinkdClose(void)
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
{
if (unlinkd_wfd > -1) {
#if USE_POLL && _SQUID_OSF_
/* pipes and poll() don't get along on DUNIX -DW */
IPC_STREAM,
-#elif _SQUID_MSWIN_
+#elif _SQUID_WINDOWS_
/* select() will fail on a pipe */
IPC_TCP_SOCKET,
#else
debugs(2, DBG_IMPORTANT, "Unlinkd pipe opened on FD " << unlinkd_wfd);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
debugs(2, 4, "Unlinkd handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid);
#include "squid_windows.h"
#include "win32.h"
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#if HAVE_WIN32_PSAPI
#include <psapi.h>
#endif
*
*/
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
#if HAVE_SYS_TIME_H
#include <sys/time.h>
static int check_target_acl(const char *hostname, int port);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
static int s_iInitCount = 0;
int Win32SockInit(void)
read_reply(int s, cachemgr_request * req)
{
char buf[4 * 1024];
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
int reply;
char *tmpfile = tempnam(NULL, "tmp0000");
parse_menu = 1;
if (fp == NULL) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
perror(tmpfile);
xfree(tmpfile);
#else
return 1;
}
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
while ((reply=recv(s, buf , sizeof(buf), 0)) > 0)
fwrite(buf, 1, reply, fp);
}
fclose(fp);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
remove(tmpfile);
xfree(tmpfile);
cachemgr_request *req;
now = time(NULL);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
Win32SockInit();
atexit(Win32SockCleanup);
else
return NULL;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
if (strlen(buf) == 0 || strlen(buf) == 4000)
#else