*/
#include "squid.h"
+#include "comm/Loops.h"
#include <sys/ipc.h>
#include <sys/msg.h>
fd_note(wfd, "squid -> diskd");
commSetTimeout(wfd, -1, NULL, NULL);
-
commSetNonBlocking(wfd);
-
- comm_quick_poll_required();
+ Comm::QuickPollRequired();
}
/*
$(SHELL) $(srcdir)/DiskIO/modules.sh $(DISK_MODULES) > DiskIO/DiskIOModules_gen.cc
-squid_COMMSOURCES = \
- comm_select.cc \
- comm_select.h \
- comm_select_win32.cc \
- comm_poll.cc \
- comm_poll.h \
- comm_devpoll.cc \
- comm_epoll.cc \
- comm_epoll.h \
- comm_kqueue.cc \
- comm_kqueue.h
-
-
# common library for all the binaries and tests. This is kindof a catch all
# and smaller libraries split from this are encouraged. Using lt convenience
# libraries, dependencies should not be a problem either.
CommIO.h \
CompletionDispatcher.cc \
CompletionDispatcher.h \
- $(squid_COMMSOURCES) \
CommRead.h \
ConfigOption.cc \
ConfigParser.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
- $(squid_COMMSOURCES) \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
- $(squid_COMMSOURCES) \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
- $(squid_COMMSOURCES) \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
- $(squid_COMMSOURCES) \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
- $(squid_COMMSOURCES) \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
client_side_request.cc \
ClientInfo.h \
clientStream.cc \
- $(squid_COMMSOURCES) \
ConfigOption.cc \
ConfigParser.cc \
CpuAffinityMap.cc \
#include "acl/FilledChecklist.h"
#include "auth/UserRequest.h"
+#include "base/TextException.h"
#include "ChunkedCodingParser.h"
#include "client_side.h"
#include "client_side_reply.h"
#include "client_side_request.h"
+#if USE_DELAY_POOLS
+#include "ClientInfo.h"
+#endif
#include "ClientRequestContext.h"
#include "clientStream.h"
#include "comm.h"
#include "comm/Write.h"
#include "comm/ListenStateData.h"
-#include "base/TextException.h"
+#include "comm/Loops.h"
#include "ConnectionDetail.h"
#include "eui/Config.h"
#include "fde.h"
#include "ProtoPort.h"
#include "rfc1738.h"
#include "SquidTime.h"
-#include "Store.h"
-
-#if USE_DELAY_POOLS
-#include "ClientInfo.h"
-#endif
-
#if USE_SSL
#include "ssl/context_storage.h"
#include "ssl/helper.h"
#include "ssl/crtd_message.h"
#include "ssl/certificate_db.h"
#endif
+#include "Store.h"
#if HAVE_LIMITS
#include <limits>
/*
* Aha, but we don't want a read handler!
*/
- commSetSelect(io.fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(io.fd, COMM_SELECT_READ, NULL, NULL, 0);
}
#else
switch (ssl_error) {
case SSL_ERROR_WANT_READ:
- commSetSelect(fd, COMM_SELECT_READ, clientNegotiateSSL, conn, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, clientNegotiateSSL, conn, 0);
return;
case SSL_ERROR_WANT_WRITE:
- commSetSelect(fd, COMM_SELECT_WRITE, clientNegotiateSSL, conn, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, clientNegotiateSSL, conn, 0);
return;
case SSL_ERROR_SYSCALL:
commSetTcpKeepalive(newfd, s->http.tcp_keepalive.idle, s->http.tcp_keepalive.interval, s->http.tcp_keepalive.timeout);
}
- commSetSelect(newfd, COMM_SELECT_READ, clientNegotiateSSL, connState, 0);
+ Comm::SetSelect(newfd, COMM_SELECT_READ, clientNegotiateSSL, connState, 0);
clientdbEstablished(details->peer, 1);
// commSetTimeout() was called for this request before we switched.
// Disable the client read handler until peer selection is complete
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
-
- commSetSelect(fd, COMM_SELECT_READ, clientNegotiateSSL, this, 0);
-
+ Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, clientNegotiateSSL, this, 0);
switchedToHttps_ = true;
return true;
}
#include "comm/IoCallback.h"
#include "comm/Write.h"
#include "comm/ListenStateData.h"
+#include "comm/Loops.h"
#include "CommIO.h"
#include "CommRead.h"
#include "ConnectionDetail.h"
}
/* Nope, register for some more IO */
- commSetSelect(fd, COMM_SELECT_READ, commHandleRead, data, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, commHandleRead, data, 0);
}
/**
/* Queue the read */
ccb->setCallback(Comm::IOCB_READ, callback, (char *)buf, NULL, size);
- commSetSelect(fd, COMM_SELECT_READ, commHandleRead, ccb, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, commHandleRead, ccb, 0);
}
/**
cb->cancel("old comm_read_cancel");
/* And the IO event */
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
void
cb->cancel("comm_read_cancel");
/* And the IO event */
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
F->local_addr.FreeAddrInfo(AI);
return 0;
}
- commResetSelect(fd);
+ Comm::ResetSelect(fd);
close(fd2);
case COMM_INPROGRESS:
debugs(5, 5, HERE << "FD " << fd << ": COMM_INPROGRESS");
- commSetSelect(fd, COMM_SELECT_WRITE, ConnectStateData::Connect, this, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, ConnectStateData::Connect, this, 0);
break;
case COMM_OK:
fd_note(fd, "lingering close");
commSetTimeout(fd, 10, commLingerTimeout, NULL);
- commSetSelect(fd, COMM_SELECT_READ, commLingerClose, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, commLingerClose, NULL, 0);
}
#endif
// notify read/write handlers after canceling select reservations, if any
if (COMMIO_FD_WRITECB(fd)->active()) {
- commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
COMMIO_FD_WRITECB(fd)->finish(COMM_ERR_CLOSING, errno);
}
if (COMMIO_FD_READCB(fd)->active()) {
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
COMMIO_FD_READCB(fd)->finish(COMM_ERR_CLOSING, errno);
}
conn_close_pool = memPoolCreate("close_handler", sizeof(close_handler));
TheHalfClosed = new DescriptorSet;
+
+ /* setup the select loop module */
+ Comm::SelectLoopInit();
}
void
!fd_table[head].closing()) {
// wait for the head descriptor to become ready for writing
- commSetSelect(head, COMM_SELECT_WRITE, Comm::HandleWrite, ccb, 0);
+ Comm::SetSelect(head, COMM_SELECT_WRITE, Comm::HandleWrite, ccb, 0);
clientInfo->selectWaiting = true;
return;
}
if (writeTimedOut(fd)) {
// We have an active write callback and we are timed out
debugs(5, 5, "checkTimeouts: FD " << fd << " auto write timeout");
- commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
COMMIO_FD_WRITECB(fd)->finish(COMM_ERROR, ETIMEDOUT);
} else if (AlreadyTimedOut(F))
continue;
fd_open(DoneFD, FD_PIPE, "async-io completetion event: threads");
commSetNonBlocking(DoneReadFD);
commSetNonBlocking(DoneFD);
- commSetSelect(DoneReadFD, COMM_SELECT_READ, NULLFDHandler, NULL, 0);
+ Comm::SetSelect(DoneReadFD, COMM_SELECT_READ, NULLFDHandler, NULL, 0);
Initialised = true;
}
CommIO::NULLFDHandler(int fd, void *data)
{
FlushPipe();
- commSetSelect(fd, COMM_SELECT_READ, NULLFDHandler, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, NULLFDHandler, NULL, 0);
}
void
checkTimeouts();
}
- switch (comm_select(timeout)) {
+ switch (Comm::DoSelect(timeout)) {
case COMM_OK:
SQUIDCEXTERN int comm_openex(int, int, Ip::Address &, int, tos_t tos, nfmark_t nfmark, const char *);
SQUIDCEXTERN u_short comm_local_port(int fd);
-SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t);
-SQUIDCEXTERN void commResetSelect(int);
-
SQUIDCEXTERN int comm_udp_sendto(int sock, const Ip::Address &to, const void *buf, int buflen);
SQUIDCEXTERN void commCallCloseHandlers(int fd);
SQUIDCEXTERN int commSetTimeout(int fd, int, PF *, void *);
SQUIDCEXTERN void checkTimeouts(void);
-/*
- * comm_select.c
- */
-SQUIDCEXTERN void comm_select_init(void);
-SQUIDCEXTERN comm_err_t comm_select(int);
-SQUIDCEXTERN void comm_quick_poll_required(void);
-
class ConnectionDetail;
typedef void IOACB(int fd, int nfd, ConnectionDetail *details, comm_err_t flag, int xerrno, void *data);
extern void comm_add_close_handler(int fd, PF *, void *);
#include "config.h"
#include "ClientInfo.h"
#include "comm/IoCallback.h"
+#include "comm/Loops.h"
#include "comm/Write.h"
#include "CommCalls.h"
#include "fde.h"
}
#endif
- commSetSelect(fd, COMM_SELECT_WRITE, Comm::HandleWrite, this, 0);
+ SetSelect(fd, COMM_SELECT_WRITE, Comm::HandleWrite, this, 0);
}
void
#include "comm/AcceptLimiter.h"
#include "comm/comm_internal.h"
#include "comm/ListenStateData.h"
+#include "comm/Loops.h"
#include "ConnectionDetail.h"
#include "fde.h"
#include "protos.h"
debugs(5, 5, HERE << "FD " << fd << " AsyncCall: " << call);
assert(isOpen(aFd));
setListen();
- commSetSelect(fd, COMM_SELECT_READ, doAccept, this, 0);
+ SetSelect(fd, COMM_SELECT_READ, doAccept, this, 0);
}
Comm::ListenStateData::~ListenStateData()
} else {
afd->acceptNext();
}
- commSetSelect(fd, COMM_SELECT_READ, Comm::ListenStateData::doAccept, afd, 0);
+ SetSelect(fd, COMM_SELECT_READ, Comm::ListenStateData::doAccept, afd, 0);
}
bool
if (newfd == COMM_NOMESSAGE) {
/* register interest again */
debugs(5, 5, HERE << "try later: FD " << fd << " handler: " << theCallback);
- commSetSelect(fd, COMM_SELECT_READ, doAccept, this, 0);
+ SetSelect(fd, COMM_SELECT_READ, doAccept, this, 0);
return;
}
--- /dev/null
+#ifndef _SQUID_SRC_COMM_LOOPS_H
+#define _SQUID_SRC_COMM_LOOPS_H
+
+#include "comm_err_t.h"
+
+/* Comm layer select loops API.
+ *
+ * These API functions must be implemented by all FD IO loops used by Squid.
+ * Defines are provided short-term for legacy code. These will disappear soon.
+ */
+
+namespace Comm {
+
+/// Initialize the module on Squid startup
+extern void SelectLoopInit(void);
+
+/// Mark an FD to be watched for its IO status.
+extern void SetSelect(int, unsigned int, PF *, void *, time_t);
+
+/// reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
+extern void ResetSelect(int);
+
+/** Perform a select() or equivalent call.
+ * This is used by the main select loop engine to check for FD with IO available.
+ */
+extern comm_err_t DoSelect(int);
+
+extern void QuickPollRequired(void);
+
+} // namespace Comm
+
+#endif /* _SQUID_SRC_COMM_LOOPS_H */
AcceptLimiter.h \
ListenStateData.cc \
ListenStateData.h \
+ Loops.h \
+ ModDevPoll.cc \
+ ModEpoll.cc \
+ ModKqueue.cc \
+ ModPoll.cc \
+ ModSelect.cc \
+ ModSelectWin32.cc \
\
IoCallback.cc \
IoCallback.h \
* Last modified 2010-10-08
*/
-
-#include "squid.h"
-
/*
* There are several poll types in Squid, ALL of which are compiled and linked
* in. Thus conditional compile-time flags are used to prevent the different
* modules from creating several versions of the same function simultaneously.
*/
+#include "config.h"
+
#if USE_DEVPOLL
-#include "Store.h"
+#include "squid.h"
+#include "comm/Loops.h"
#include "fde.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
+#include "Store.h"
#if HAVE_SYS_DEVPOLL_H
/* Solaris /dev/poll support, see "man -s 7D poll" */
* Allocates memory, opens /dev/poll device handle.
*/
void
-comm_select_init(void)
+Comm::SelectLoopInit(void)
{
/* allocate memory first before attempting to open poll device */
/* This tracks the FD devpoll offset+state */
* @param timeout if non-zero then timeout relative to now
*/
void
-commSetSelect(int fd, unsigned int type, PF * handler,
- void *client_data, time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
assert(fd >= 0);
debugs(
* @param fd file descriptor to clear polling on
*/
void
-commResetSelect(int fd)
+Comm::ResetSelect(int fd)
{
- commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
* @param msec milliseconds to poll for (limited by max_poll_time)
*/
comm_err_t
-comm_select(int msec)
+Comm::DoSelect(int msec)
{
int num, i;
fde *F;
HERE << "no read handler for FD " << fd
);
// remove interest since no handler exist for this event.
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
}
HERE << "no write handler for FD " << fd
);
// remove interest since no handler exist for this event.
- commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
}
}
}
return COMM_OK;
}
-
void
-comm_quick_poll_required(void)
+Comm::QuickPollRequired(void)
{
max_poll_time = 10;
}
*
*/
+#include "config.h"
+
+#if USE_EPOLL
+
#include "squid.h"
-#include "comm_epoll.h"
-#include "mgr/Registration.h"
-#include "Store.h"
+#include "comm/Loops.h"
#include "fde.h"
+#include "mgr/Registration.h"
#include "SquidTime.h"
-
-#if USE_EPOLL
+#include "Store.h"
#define DEBUG_EPOLL 0
/*
- * comm_select_init
- *
* This is a needed exported function which will be called to initialise
* the network loop code.
*/
void
-comm_select_init(void)
+Comm::SelectLoopInit(void)
{
-
pevents = (struct epoll_event *) xmalloc(SQUID_MAXFD * sizeof(struct epoll_event));
if (!pevents) {
}
}
-/*
- * comm_setselect
- *
+/**
* This is a needed exported function which will be called to register
* and deregister interest in a pending IO state for a given FD.
- *
*/
void
-commSetSelect(int fd, unsigned int type, PF * handler,
- void *client_data, time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
fde *F = &fd_table[fd];
int epoll_ctl_type = 0;
struct epoll_event ev;
assert(fd >= 0);
- debugs(5, DEBUG_EPOLL ? 0 : 8, "commSetSelect(FD " << fd << ",type=" << type <<
- ",handler=" << handler << ",client_data=" << client_data <<
- ",timeout=" << timeout << ")");
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "FD " << fd << ", type=" << type <<
+ ", handler=" << handler << ", client_data=" << client_data <<
+ ", timeout=" << timeout);
if (RUNNING_ON_VALGRIND) {
/* Keep valgrind happy.. complains about uninitialized bytes otherwise */
F->epoll_state = ev.events;
if (epoll_ctl(kdpfd, epoll_ctl_type, fd, &ev) < 0) {
- debugs(5, DEBUG_EPOLL ? 0 : 8, "commSetSelect: epoll_ctl(," << epolltype_atoi(epoll_ctl_type) <<
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "epoll_ctl(," << epolltype_atoi(epoll_ctl_type) <<
",,): failed on FD " << fd << ": " << xstrerror());
}
}
}
void
-commResetSelect(int fd)
+Comm::ResetSelect(int fd)
{
fde *F = &fd_table[fd];
F->epoll_state = 0;
- commSetSelect(fd, 0, NULL, NULL, 0);
+ SetSelect(fd, 0, NULL, NULL, 0);
}
statHistDump(&f->select_fds_hist, sentry, statHistIntDumper);
}
-/*
- * comm_select
+/**
* Check all connections for new connections and input data that is to be
* processed. Also check for connections with data queued and whether we can
* write it out.
* comm_setselect and fd_table[] and calls callbacks for IO ready
* events.
*/
-
comm_err_t
-comm_select(int msec)
+Comm::DoSelect(int msec)
{
int num, i,fd;
fde *F;
for (i = 0, cevents = pevents; i < num; i++, cevents++) {
fd = cevents->data.fd;
F = &fd_table[fd];
- debugs(5, DEBUG_EPOLL ? 0 : 8, "comm_select(): got FD " << fd << " events=" <<
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "got FD " << fd << " events=" <<
std::hex << cevents->events << " monitoring=" << F->epoll_state <<
" F->read_handler=" << F->read_handler << " F->write_handler=" << F->write_handler);
if (cevents->events & (EPOLLIN|EPOLLHUP|EPOLLERR) || F->flags.read_pending) {
if ((hdl = F->read_handler) != NULL) {
- debugs(5, DEBUG_EPOLL ? 0 : 8, "comm_select(): Calling read handler on FD " << fd);
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "Calling read handler on FD " << fd);
PROF_start(comm_write_handler);
F->flags.read_pending = 0;
F->read_handler = NULL;
PROF_stop(comm_write_handler);
statCounter.select_fds++;
} else {
- debugs(5, DEBUG_EPOLL ? 0 : 8, "comm_select(): no read handler for FD " << fd);
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "no read handler for FD " << fd);
// remove interest since no handler exist for this event.
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
}
}
if (cevents->events & (EPOLLOUT|EPOLLHUP|EPOLLERR)) {
if ((hdl = F->write_handler) != NULL) {
- debugs(5, DEBUG_EPOLL ? 0 : 8, "comm_select(): Calling write handler on FD " << fd);
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "Calling write handler on FD " << fd);
PROF_start(comm_read_handler);
F->write_handler = NULL;
hdl(fd, F->write_data);
PROF_stop(comm_read_handler);
statCounter.select_fds++;
} else {
- debugs(5, DEBUG_EPOLL ? 0 : 8, "comm_select(): no write handler for FD " << fd);
+ debugs(5, DEBUG_EPOLL ? 0 : 8, HERE << "no write handler for FD " << fd);
// remove interest since no handler exist for this event.
- commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
}
}
}
}
void
-comm_quick_poll_required(void)
+Comm::QuickPollRequired(void)
{
max_poll_time = 10;
}
* so deferred reads aren't required.
* -- adrian
*/
-
-#include "squid.h"
+#include "config.h"
#if USE_KQUEUE
-#include "comm_kqueue.h"
-#include "Store.h"
+#include "squid.h"
+#include "comm/Loops.h"
#include "fde.h"
+#include "Store.h"
#include "SquidTime.h"
#if HAVE_SYS_EVENT_H
* the network loop code.
*/
void
-comm_select_init(void)
+Comm::SelectLoopInit(void)
{
kq = kqueue();
* and deregister interest in a pending IO state for a given FD.
*/
void
-commSetSelect(int fd, unsigned int type, PF * handler,
- void *client_data, time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
fde *F = &fd_table[fd];
assert(fd >= 0);
}
void
-commResetSelect(int fd)
+Comm::ResetSelect(int fd)
{
fde *F = &fd_table[fd];
if (F->read_handler) {
*/
comm_err_t
-comm_select(int msec)
+Comm::Select(int msec)
{
int num, i;
}
void
-comm_quick_poll_required(void)
+Comm::QuickPollRequired(void)
{
max_poll_time = 10;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
+#include "config.h"
+
+#if USE_POLL
#include "squid.h"
-#include "comm_poll.h"
+#include "comm/Loops.h"
+#include "fde.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
#include "Store.h"
-#include "fde.h"
-
-#if USE_POLL
#if HAVE_POLL_H
#include <poll.h>
#endif
#endif
-static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */
+static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
void
-commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
- time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
fde *F = &fd_table[fd];
assert(fd >= 0);
}
void
-commResetSelect(int fd)
+Comm::ResetSelect(int fd)
{
}
/* poll all sockets; call handlers for those that are ready. */
comm_err_t
-comm_select(int msec)
+Comm::DoSelect(int msec)
{
-
struct pollfd pfds[SQUID_MAXFD];
PF *hdl = NULL;
}
void
-comm_select_init(void)
+Comm::SelectLoopInit(void)
{
commPollRegisterWithCacheManager();
}
/* Called by async-io or diskd to speed up the polling */
void
-comm_quick_poll_required(void)
+Comm::QuickPollRequired(void)
{
MAX_POLL_TIME = 10;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
+#include "config.h"
+
+#if USE_SELECT
#include "squid.h"
-#include "comm_select.h"
+#include "comm/Loops.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
-
-#if USE_SELECT
#include "Store.h"
#include "fde.h"
-static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */
+static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#define commCheckHTTPIncoming (++http_io_events > (incoming_http_interval>> INCOMING_FACTOR))
void
-commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
- time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
fde *F = &fd_table[fd];
assert(fd >= 0);
assert(F->flags.open);
- debugs(5, 5, "commSetSelect: FD " << fd << " type " << type);
+ debugs(5, 5, HERE << "FD " << fd << " type " << type);
if (type & COMM_SELECT_READ) {
F->read_handler = handler;
}
void
-commResetSelect(int fd)
+Comm::ResetSelect(int fd)
{
}
#define DEBUG_FDBITS 0
/* Select on all sockets; call handlers for those that are ready. */
comm_err_t
-comm_select(int msec)
+Comm::DoSelect(int msec)
{
fd_set readfds;
fd_set pendingfds;
statHistCount(&statCounter.comm_dns_incoming, nevents);
}
-static void
-commSelectRegisterWithCacheManager(void)
-{
- Mgr::RegisterAction("comm_select_incoming",
- "comm_incoming() stats",
- commIncomingStats, 0, 1);
-}
-
void
-comm_select_init(void)
+Comm::SelectLoopInit(void)
{
zero_tv.tv_sec = 0;
zero_tv.tv_usec = 0;
FD_ZERO(&global_writefds);
nreadfds = nwritefds = 0;
- commSelectRegisterWithCacheManager();
+ Mgr::RegisterAction("comm_select_incoming",
+ "comm_incoming() stats",
+ commIncomingStats, 0, 1);
}
/*
/* Called by async-io or diskd to speed up the polling */
void
-comm_quick_poll_required(void)
+Comm::QuickPollRequired(void)
{
MAX_POLL_TIME = 10;
}
*
*/
+#include "config.h"
+
+#if USE_SELECT_WIN32
+
#include "squid.h"
-#include "comm_select.h"
+#include "comm/Loops.h"
+#include "fde.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
-
-#if USE_SELECT_WIN32
#include "Store.h"
-#include "fde.h"
-static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */
+static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#define commCheckHTTPIncoming (++http_io_events > (incoming_http_interval>> INCOMING_FACTOR))
void
-commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
- time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
fde *F = &fd_table[fd];
assert(fd >= 0);
}
void
-commResetSelect(int fd)
+Comm::ResetSelect(int fd)
{
}
#define DEBUG_FDBITS 0
/* Select on all sockets; call handlers for those that are ready. */
comm_err_t
-comm_select(int msec)
+Comm::DoSelect(int msec)
{
fd_set readfds;
fd_set pendingfds;
statHistCount(&statCounter.comm_dns_incoming, nevents);
}
-static void
-commSelectRegisterWithCacheManager(void)
-{
- Mgr::RegisterAction("comm_select_incoming",
- "comm_incoming() stats",
- commIncomingStats, 0, 1);
-}
-
void
-comm_select_init(void)
+Comm::SelectLoopInit(void)
{
zero_tv.tv_sec = 0;
zero_tv.tv_usec = 0;
FD_ZERO(&global_writefds);
nreadfds = nwritefds = 0;
- commSelectRegisterWithCacheManager();
+ Mgr::RegisterAction("comm_select_incoming",
+ "comm_incoming() stats",
+ commIncomingStats, 0, 1);
}
/*
/* Called by async-io or diskd to speed up the polling */
void
-comm_quick_poll_required(void)
+Comm::QuickPollRequired(void)
{
MAX_POLL_TIME = 10;
}
+++ /dev/null
-
-/*
- * $Id$
- *
- *
- * SQUID Web Proxy Cache http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- * Squid is the result of efforts by numerous individuals from
- * the Internet community; see the CONTRIBUTORS file for full
- * details. Many organizations have provided support for Squid's
- * development; see the SPONSORS file for full details. Squid is
- * Copyrighted (C) 2001 by the Regents of the University of
- * California; see the COPYRIGHT file for full details. Squid
- * incorporates software developed and/or copyrighted by other
- * sources; see the CREDITS file for full details.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- */
-
-#ifndef SQUID_COMM_EPOLL_H
-#define SQUID_COMM_EPOLL_H
-
-#endif /* SQUID_COMM_EPOLL_H */
+++ /dev/null
-
-/*
- * $Id$
- *
- *
- * SQUID Web Proxy Cache http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- * Squid is the result of efforts by numerous individuals from
- * the Internet community; see the CONTRIBUTORS file for full
- * details. Many organizations have provided support for Squid's
- * development; see the SPONSORS file for full details. Squid is
- * Copyrighted (C) 2001 by the Regents of the University of
- * California; see the COPYRIGHT file for full details. Squid
- * incorporates software developed and/or copyrighted by other
- * sources; see the CREDITS file for full details.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- */
-
-#ifndef SQUID_COMM_KQUEUE_H
-#define SQUID_COMM_KQUEUE_H
-
-#endif /* SQUID_COMM_KQUEUE_H */
+++ /dev/null
-
-/*
- * $Id$
- *
- *
- * SQUID Web Proxy Cache http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- * Squid is the result of efforts by numerous individuals from
- * the Internet community; see the CONTRIBUTORS file for full
- * details. Many organizations have provided support for Squid's
- * development; see the SPONSORS file for full details. Squid is
- * Copyrighted (C) 2001 by the Regents of the University of
- * California; see the COPYRIGHT file for full details. Squid
- * incorporates software developed and/or copyrighted by other
- * sources; see the CREDITS file for full details.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- */
-
-#ifndef SQUID_COMM_SELECT_H
-#define SQUID_COMM_SELECT_H
-
-
-#endif /* SQUID_COMM_SELECT_H */
*/
#include "squid.h"
+#include "comm/Loops.h"
#include "fde.h"
#include "MemBuf.h"
} else {
/* another block is queued */
diskCombineWrites(fdd);
- commSetSelect(fd, COMM_SELECT_WRITE, diskHandleWrite, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, diskHandleWrite, NULL, 0);
F->flags.write_daemon = 1;
}
if (len < 0) {
if (ignoreErrno(errno)) {
- commSetSelect(fd, COMM_SELECT_READ, diskHandleRead, ctrl_dat, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, diskHandleRead, ctrl_dat, 0);
PROF_stop(diskHandleRead);
return;
}
-
/*
* $Id$
*
*
*/
-#include "config.h"
#include "squid.h"
+#include "comm.h"
+#include "comm/Loops.h"
+#include "comm/Write.h"
#include "event.h"
#include "SquidTime.h"
#include "Store.h"
-#include "comm.h"
-#include "comm/Write.h"
#include "fde.h"
#include "ip/tools.h"
#include "MemBuf.h"
// Always keep reading. This stops (or at least makes harder) several
// attacks on the DNS client.
- commSetSelect(fd, COMM_SELECT_READ, idnsRead, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, idnsRead, NULL, 0);
/* BUG (UNRESOLVED)
* two code lines after returning from comm_udprecvfrom()
if (DnsSocketB >= 0) {
port = comm_local_port(DnsSocketB);
debugs(78, 1, "DNS Socket created at " << addrB << ", FD " << DnsSocketB);
- commSetSelect(DnsSocketB, COMM_SELECT_READ, idnsRead, NULL, 0);
+ Comm::SetSelect(DnsSocketB, COMM_SELECT_READ, idnsRead, NULL, 0);
}
if (DnsSocketA >= 0) {
port = comm_local_port(DnsSocketA);
debugs(78, 1, "DNS Socket created at " << addrA << ", FD " << DnsSocketA);
- commSetSelect(DnsSocketA, COMM_SELECT_READ, idnsRead, NULL, 0);
+ Comm::SetSelect(DnsSocketA, COMM_SELECT_READ, idnsRead, NULL, 0);
}
}
*/
#include "squid.h"
+#include "comm/Loops.h"
#include "fde.h"
#include "SquidTime.h"
#include "Debug.h"
}
debugs(51, 3, "fd_close FD " << fd << " " << F->desc);
- commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
- commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
F->flags.open = 0;
fdUpdateBiggest(fd, 0);
Number_FD--;
#include "acl/FilledChecklist.h"
#include "acl/Gadgets.h"
#include "CacheManager.h"
+#include "comm/Loops.h"
#include "event.h"
#include "errorpage.h"
#include "fde.h"
switch (ssl_error) {
case SSL_ERROR_WANT_READ:
- commSetSelect(fd, COMM_SELECT_READ, fwdNegotiateSSLWrapper, this, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, fwdNegotiateSSLWrapper, this, 0);
return;
case SSL_ERROR_WANT_WRITE:
- commSetSelect(fd, COMM_SELECT_WRITE, fwdNegotiateSSLWrapper, this, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, fwdNegotiateSSLWrapper, this, 0);
return;
default:
*/
#include "squid.h"
-#include "htcp.h"
+#include "AccessLogEntry.h"
#include "acl/FilledChecklist.h"
#include "acl/Acl.h"
-#include "ip/tools.h"
-#include "SquidTime.h"
-#include "Store.h"
-#include "StoreClient.h"
-#include "HttpRequest.h"
#include "comm.h"
-#include "MemBuf.h"
+#include "comm/Loops.h"
+#include "htcp.h"
#include "http.h"
+#include "HttpRequest.h"
#include "icmp/net_db.h"
-#include "AccessLogEntry.h"
#include "ipc/StartListening.h"
+#include "ip/tools.h"
+#include "MemBuf.h"
+#include "SquidTime.h"
+#include "Store.h"
+#include "StoreClient.h"
/// dials htcpIncomingConnectionOpened call
class HtcpListeningStartedDialer: public CallDialer,
htcpHandleMsg(buf, len, from);
- commSetSelect(fd, COMM_SELECT_READ, htcpRecv, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, htcpRecv, NULL, 0);
}
/*
if (htcpOutSocket < 0)
fatal("Cannot open Outgoing HTCP Socket");
- commSetSelect(htcpOutSocket, COMM_SELECT_READ, htcpRecv, NULL, 0);
+ Comm::SetSelect(htcpOutSocket, COMM_SELECT_READ, htcpRecv, NULL, 0);
debugs(31, 1, "Outgoing HTCP messages on port " << Config.Port.htcp << ", FD " << htcpOutSocket << ".");
if (htcpInSocket < 0)
fatal("Cannot open HTCP Socket");
- commSetSelect(htcpInSocket, COMM_SELECT_READ, htcpRecv, NULL, 0);
+ Comm::SetSelect(htcpInSocket, COMM_SELECT_READ, htcpRecv, NULL, 0);
debugs(31, 1, "Accepting HTCP messages on port " << Config.Port.htcp << ", FD " << htcpInSocket << ".");
*/
assert(htcpOutSocket > -1);
- commSetSelect(htcpOutSocket, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(htcpOutSocket, COMM_SELECT_READ, NULL, NULL, 0);
}
void
*/
#include "squid.h"
+#include "comm.h"
+#include "comm/Loops.h"
#include "icmp/IcmpSquid.h"
#include "icmp/net_db.h"
#include "ip/tools.h"
-#include "comm.h"
#include "SquidTime.h"
// Instance global to be available in main() and elsewhere.
pingerReplyData preply;
static Ip::Address F;
- commSetSelect(icmp_sock, COMM_SELECT_READ, icmpSquidRecv, NULL, 0);
+ Comm::SetSelect(icmp_sock, COMM_SELECT_READ, icmpSquidRecv, NULL, 0);
memset(&preply, '\0', sizeof(pingerReplyData));
n = comm_udp_recv(icmp_sock,
(char *) &preply,
fd_note(icmp_sock, "pinger");
- commSetSelect(icmp_sock, COMM_SELECT_READ, icmpSquidRecv, NULL, 0);
+ Comm::SetSelect(icmp_sock, COMM_SELECT_READ, icmpSquidRecv, NULL, 0);
commSetTimeout(icmp_sock, -1, NULL, NULL);
#include "squid.h"
#include "Store.h"
#include "comm.h"
+#include "comm/Loops.h"
#include "ICP.h"
#include "HttpRequest.h"
#include "acl/FilledChecklist.h"
IcpQueueTail = queue;
}
- commSetSelect(fd, COMM_SELECT_WRITE, icpUdpSendQueue, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_WRITE, icpUdpSendQueue, NULL, 0);
statCounter.icp.replies_queued++;
} else {
/* don't queue it */
int len;
int icp_version;
int max = INCOMING_ICP_MAX;
- commSetSelect(sock, COMM_SELECT_READ, icpHandleUdp, NULL, 0);
+ Comm::SetSelect(sock, COMM_SELECT_READ, icpHandleUdp, NULL, 0);
while (max--) {
len = comm_udp_recvfrom(sock,
if (theOutIcpConnection < 0)
fatal("Cannot open Outgoing ICP Port");
- commSetSelect(theOutIcpConnection,
- COMM_SELECT_READ,
- icpHandleUdp,
- NULL,
- 0);
+ Comm::SetSelect(theOutIcpConnection, COMM_SELECT_READ, icpHandleUdp, NULL, 0);
debugs(12, 1, "Outgoing ICP messages on port " << addr.GetPort() << ", FD " << theOutIcpConnection << ".");
if (theInIcpConnection < 0)
fatal("Cannot open ICP Port");
- commSetSelect(theInIcpConnection,
- COMM_SELECT_READ,
- icpHandleUdp,
- NULL,
- 0);
+ Comm::SetSelect(theInIcpConnection, COMM_SELECT_READ, icpHandleUdp, NULL, 0);
for (const wordlist *s = Config.mcast_group_list; s; s = s->next)
ipcache_nbgethostbyname(s->key, mcastJoinGroups, NULL);
*/
assert(theOutIcpConnection > -1);
- commSetSelect(theOutIcpConnection, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(theOutIcpConnection, COMM_SELECT_READ, NULL, NULL, 0);
}
void
#include "squid.h"
#include "cbdata.h"
+#include "comm/Loops.h"
#include "fde.h"
#include "log/Config.h"
#include "log/File.h"
/* there is, so schedule more */
reschedule:
- commSetSelect(ll->wfd, COMM_SELECT_WRITE, logfileHandleWrite, lf, 0);
+ Comm::SetSelect(ll->wfd, COMM_SELECT_WRITE, logfileHandleWrite, lf, 0);
ll->flush_pending = 1;
finish:
return;
logfile_mod_daemon_append(lf, "F\n", 2);
}
/* Ok, schedule a write-event */
- commSetSelect(ll->wfd, COMM_SELECT_WRITE, logfileHandleWrite, lf, 0);
+ Comm::SetSelect(ll->wfd, COMM_SELECT_WRITE, logfileHandleWrite, lf, 0);
}
static void
#if USE_DELAY_POOLS
#include "ClientDelayConfig.h"
#endif
+#include "comm.h"
#include "ConfigParser.h"
#include "CpuAffinity.h"
#if USE_DELAY_POOLS
#include "htcp.h"
#include "StoreFileSystem.h"
#include "DiskIO/DiskIOModule.h"
-#include "comm.h"
#include "ipc/Kids.h"
#include "ipc/Coordinator.h"
#include "ipc/Strand.h"
#include "ip/tools.h"
-#if USE_EPOLL
-#include "comm_epoll.h"
-#endif
-#if USE_KQUEUE
-#include "comm_kqueue.h"
-#endif
-#if USE_POLL
-#include "comm_poll.h"
-#endif
-#if defined(USE_SELECT) || defined(USE_SELECT_WIN32)
-#include "comm_select.h"
-#endif
#include "SquidTime.h"
#include "SwapDir.h"
#include "forward.h"
comm_init();
- comm_select_init();
-
mainInitialize();
test_access();
/* init comm module */
comm_init();
- comm_select_init();
-
if (opt_no_daemon) {
/* we have to init fdstat here. */
fd_open(0, FD_LOG, "stdin");
#include "acl/FilledChecklist.h"
#include "cache_snmp.h"
#include "comm.h"
+#include "comm/Loops.h"
#include "ipc/StartListening.h"
#include "ip/Address.h"
#include "ip/tools.h"
if (theInSnmpConnection < 0)
fatal("Cannot open Incoming SNMP Port");
- commSetSelect(theInSnmpConnection, COMM_SELECT_READ, snmpHandleUdp, NULL,
- 0);
+ Comm::SetSelect(theInSnmpConnection, COMM_SELECT_READ, snmpHandleUdp, NULL, 0);
debugs(1, 1, "Accepting SNMP messages on " << Config.Addrs.snmp_incoming <<
", FD " << theInSnmpConnection << ".");
if (theOutSnmpConnection < 0)
fatal("Cannot open Outgoing SNMP Port");
- commSetSelect(theOutSnmpConnection, COMM_SELECT_READ, snmpHandleUdp, NULL,
- 0);
+ Comm::SetSelect(theOutSnmpConnection, COMM_SELECT_READ, snmpHandleUdp, NULL, 0);
debugs(1, 1, "Outgoing SNMP messages on " << Config.Addrs.snmp_outgoing <<
", FD " << theOutSnmpConnection << ".");
*/
assert(theOutSnmpConnection > -1);
- commSetSelect(theOutSnmpConnection, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(theOutSnmpConnection, COMM_SELECT_READ, NULL, NULL, 0);
}
void
debugs(49, 5, "snmpHandleUdp: Called.");
- commSetSelect(sock, COMM_SELECT_READ, snmpHandleUdp, NULL, 0);
+ Comm::SetSelect(sock, COMM_SELECT_READ, snmpHandleUdp, NULL, 0);
memset(buf, '\0', SNMP_REQUEST_SIZE);
#include "squid.h"
#include "comm.h"
+#include "comm/Loops.h"
#include "CommRead.h"
#include "fde.h"
}
void
-commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
- time_t timeout)
+Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t timeout)
{
/* all test code runs synchronously at the moment */
}
void
-comm_quick_poll_required()
+Comm::QuickPollRequired()
{
/* for tests ... ignore */
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
+#include "config.h"
+
+#if USE_WCCP
+
#include "squid.h"
#include "comm.h"
+#include "comm/Loops.h"
#include "event.h"
-#if USE_WCCP
-
#define WCCP_PORT 2048
#define WCCP_REVISION 0
#define WCCP_ACTIVE_CACHES 32
if (theWccpConnection < 0)
fatal("Cannot open WCCP Port");
- commSetSelect(theWccpConnection,
- COMM_SELECT_READ,
- wccpHandleUdp,
- NULL,
- 0);
+ Comm::SetSelect(theWccpConnection, COMM_SELECT_READ, wccpHandleUdp, NULL, 0);
debugs(80, 1, "Accepting WCCPv1 messages on " << Config.Wccp.address << ", FD " << theWccpConnection << ".");
debugs(80, 6, "wccpHandleUdp: Called.");
- commSetSelect(sock, COMM_SELECT_READ, wccpHandleUdp, NULL, 0);
+ Comm::SetSelect(sock, COMM_SELECT_READ, wccpHandleUdp, NULL, 0);
memset(&wccp_i_see_you, '\0', sizeof(wccp_i_see_you));
#if USE_WCCPv2
#include "comm.h"
+#include "comm/Loops.h"
#include "compat/strsep.h"
#include "event.h"
#include "ip/Address.h"
}
#endif
- commSetSelect(theWccp2Connection,
- COMM_SELECT_READ,
- wccp2HandleUdp,
- NULL,
- 0);
+ Comm::SetSelect(theWccp2Connection, COMM_SELECT_READ, wccp2HandleUdp, NULL, 0);
debugs(80, 1, "Accepting WCCPv2 messages on port " << WCCP_PORT << ", FD " << theWccp2Connection << ".");
debugs(80, 1, "Initialising all WCCPv2 lists");
debugs(80, 6, "wccp2HandleUdp: Called.");
- commSetSelect(sock, COMM_SELECT_READ, wccp2HandleUdp, NULL, 0);
+ Comm::SetSelect(sock, COMM_SELECT_READ, wccp2HandleUdp, NULL, 0);
/* FIXME INET6 : drop conversion boundary */
Ip::Address from_tmp;