#include "squid.h"
#include "cache_cf.h"
#include "comm.h"
#include "comm/Connection.h"
#include "fd.h"
#include "fde.h"
#include "globals.h"
#include "ip/Address.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "SquidIpc.h"
#include "tools.h"
#include <cerrno>
#include <chrono>
#include <thread>
#include <process.h>
Go to the source code of this file.
Classes | |
struct | ipc_params |
struct | thread_params |
Macros | |
#define | HELLO_BUF_SZ 32 |
Functions | |
static unsigned int __stdcall | ipc_thread_1 (void *params) |
static unsigned int __stdcall | ipc_thread_2 (void *params) |
static int | ipcCloseAllFD (int prfd, int pwfd, int crfd, int cwfd) |
static void | PutEnvironment () |
pid_t | ipcCreate (int type, const char *prog, const char *const args[], const char *name, Ip::Address &local_addr, int *rfd, int *wfd, void **hIpc) |
static int | ipcSend (int cwfd, const char *buf, int len) |
Variables | |
static const char * | ok_string = "OK\n" |
static const char * | err_string = "ERR\n" |
static const char * | shutdown_string = "$shutdown\n" |
static const char * | hello_string = "hi there\n" |
static char | hello_buf [HELLO_BUF_SZ] |
Macro Definition Documentation
◆ HELLO_BUF_SZ
#define HELLO_BUF_SZ 32 |
Definition at line 59 of file ipc_win32.cc.
Function Documentation
◆ ipc_thread_1()
|
static |
Definition at line 348 of file ipc_win32.cc.
References ipc_params::args, assert, comm_close, comm_connect_addr(), Comm::COMM_ERROR, comm_open(), commUnsetNonBlocking(), ipc_params::crfd, ipc_params::cwfd, DBG_CRITICAL, debug_log, debugs, err_string, F(), fd_note(), fd_open(), FD_SOCKET, fd_table, Ip::Address::FreeAddr(), getCurrentTime(), hello_buf, hello_string, Ip::Address::InitAddr(), IPC_TCP_SOCKET, ipc_thread_2(), IPC_UDP_SOCKET, ipcCloseAllFD(), ipcSend(), ipc_params::local_addr, ok_string, pid, thread_params::pid, ipc_params::prog, thread_params::prog, ipc_params::PS, PutEnvironment(), rfc1738_escape, rfc1738_escape_unescaped, thread_params::rfd, thread_params::send_fd, shutdown_string, Squid_MaxFD, TRUE, ipc_params::type, thread_params::type, w_space, xcalloc(), xfree, xstrdup, and xstrerr().
Referenced by ipcCreate().
◆ ipc_thread_2()
|
static |
Definition at line 792 of file ipc_win32.cc.
References debugs, IPC_TCP_SOCKET, IPC_UDP_SOCKET, pid, thread_params::pid, thread_params::prog, rfc1738_escape_unescaped, thread_params::rfd, thread_params::send_fd, shutdown_string, thread_params::type, xcalloc(), xfree, and xstrdup.
Referenced by ipc_thread_1().
◆ ipcCloseAllFD()
Definition at line 63 of file ipc_win32.cc.
References comm_close.
Referenced by ipc_thread_1(), and ipcCreate().
◆ ipcCreate()
pid_t ipcCreate | ( | int | type, |
const char * | prog, | ||
const char *const | args[], | ||
const char * | name, | ||
Ip::Address & | local_addr, | ||
int * | rfd, | ||
int * | wfd, | ||
void ** | hIpc | ||
) |
Definition at line 95 of file ipc_win32.cc.
References ipc_params::args, assert, comm_connect_addr(), Comm::COMM_ERROR, COMM_NOCLOEXEC, comm_open(), comm_open_listener(), commSetCloseOnExec(), commSetNonBlocking(), commUnsetFdTimeout(), Config, ipc_params::crfd, ipc_params::cwfd, DBG_CRITICAL, DBG_IMPORTANT, debugs, err_string, fd_table, Ip::Address::FreeAddr(), hello_buf, HELLO_BUF_SZ, hello_string, hIpc, Ip::Address::InitAddr(), IPC_FIFO, IPC_NONE, IPC_TCP_SOCKET, ipc_thread_1(), IPC_UDP_SOCKET, ipcCloseAllFD(), ipc_params::local_addr, logsFlush(), ok_string, pid, ipc_params::prog, ipc_params::PS, requirePathnameExists(), rfc1738_escape, Ip::Address::setEmpty(), SquidConfig::sleep_after_fork, ipc_params::type, and xstrerr().
◆ ipcSend()
Definition at line 334 of file ipc_win32.cc.
References DBG_CRITICAL, debugs, and xstrerr().
Referenced by ipc_thread_1().
◆ PutEnvironment()
|
static |
Definition at line 83 of file ipc_win32.cc.
References Debug::debugOptions, and xcalloc().
Referenced by ipc_thread_1().
Variable Documentation
◆ err_string
|
static |
Definition at line 55 of file ipc_win32.cc.
Referenced by ipc_thread_1(), ipcCreate(), and main().
◆ hello_buf
|
static |
Definition at line 60 of file ipc_win32.cc.
Referenced by ipc_thread_1(), and ipcCreate().
◆ hello_string
|
static |
Definition at line 58 of file ipc_win32.cc.
Referenced by ipc_thread_1(), and ipcCreate().
◆ ok_string
|
static |
Definition at line 54 of file ipc_win32.cc.
Referenced by ipc_thread_1(), and ipcCreate().
◆ shutdown_string
|
static |
Definition at line 56 of file ipc_win32.cc.
Referenced by ipc_thread_1(), and ipc_thread_2().