}
// We should disable read/write handlers
- Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);
- Comm::SetSelect(clientConnection->fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ Comm::ResetSelect(clientConnection->fd);
if (unsupportedProtocol) {
Http::StreamPointer context = pipeline.front();
#include "comm/Flag.h"
#include "comm/forward.h"
+#include "defines.h"
/* Comm layer select loops API.
*
void SetSelect(int, unsigned int, PF *, void *, time_t);
/// reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
-void ResetSelect(int);
+inline void
+ResetSelect(int fd)
+{
+ SetSelect(fd, COMM_SELECT_READ|COMM_SELECT_WRITE, nullptr, nullptr, 0);
+}
/** Perform a select() or equivalent call.
* This is used by the main select loop engine to check for FD with IO available.
F->timeout = squid_curtime + timeout;
}
-/** \brief Clear polling of file handle (both read and write)
- *
- * @param fd file descriptor to clear polling on
- */
-void
-Comm::ResetSelect(int fd)
-{
- SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
- SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
-}
-
/** \brief Do poll and trigger callback functions as appropriate
*
* Check all connections for new connections and input data that is to be
F->timeout = squid_curtime + timeout;
}
-void
-Comm::ResetSelect(int fd)
-{
- fde *F = &fd_table[fd];
- F->epoll_state = 0;
- SetSelect(fd, 0, NULL, NULL, 0);
-}
-
static void commIncomingStats(StoreEntry * sentry);
static void
{
fde *F = &fd_table[fd];
assert(fd >= 0);
- assert(F->flags.open);
+ assert(F->flags.open || (!handler && !client_data && !timeout));
debugs(5, 5, HERE << "FD " << fd << ", type=" << type <<
", handler=" << handler << ", client_data=" << client_data <<
", timeout=" << timeout);
}
-void
-Comm::ResetSelect(int fd)
-{
- fde *F = &fd_table[fd];
- if (F->read_handler) {
- kq_update_events(fd, EVFILT_READ, (PF *)1);
- }
- if (F->write_handler) {
- kq_update_events(fd, EVFILT_WRITE, (PF *)1);
- }
-}
-
/*
* 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
{
fde *F = &fd_table[fd];
assert(fd >= 0);
- assert(F->flags.open);
+ assert(F->flags.open || (!handler && !client_data && !timeout));
debugs(5, 5, HERE << "FD " << fd << ", type=" << type <<
", handler=" << handler << ", client_data=" << client_data <<
", timeout=" << timeout);
F->timeout = squid_curtime + timeout;
}
-void
-Comm::ResetSelect(int fd)
-{
-}
-
static int
fdIsUdpListen(int fd)
{
{
fde *F = &fd_table[fd];
assert(fd >= 0);
- assert(F->flags.open);
+ assert(F->flags.open || (!handler && !client_data && !timeout));
debugs(5, 5, HERE << "FD " << fd << ", type=" << type <<
", handler=" << handler << ", client_data=" << client_data <<
", timeout=" << timeout);
F->timeout = squid_curtime + timeout;
}
-void
-Comm::ResetSelect(int fd)
-{
-}
-
static int
fdIsUdpListener(int fd)
{
{
fde *F = &fd_table[fd];
assert(fd >= 0);
- assert(F->flags.open);
+ assert(F->flags.open || (!handler && !client_data && !timeout));
debugs(5, 5, HERE << "FD " << fd << ", type=" << type <<
", handler=" << handler << ", client_data=" << client_data <<
", timeout=" << timeout);
F->timeout = squid_curtime + timeout;
}
-void
-Comm::ResetSelect(int fd)
-{
-}
-
static int
fdIsUdpListener(int fd)
{
}
debugs(51, 3, "fd_close FD " << fd << " " << F->desc);
- Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
- Comm::SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
+ Comm::ResetSelect(fd);
F->flags.open = false;
fdUpdateBiggest(fd, 0);
--Number_FD;
#include "comm/Loops.h"
void Comm::SelectLoopInit(void) STUB
void Comm::SetSelect(int, unsigned int, PF *, void *, time_t) STUB
-void Comm::ResetSelect(int) STUB
Comm::Flag Comm::DoSelect(int) STUB_RETVAL(Comm::COMM_ERROR)
void Comm::QuickPollRequired(void) STUB