#include "squid.h"
#include "comm.h"
#include "comm/IoCallback.h"
#include "comm/Loops.h"
#include "comm/Read.h"
#include "comm_internal.h"
#include "CommCalls.h"
#include "debug/Stream.h"
#include "fd.h"
#include "fde.h"
#include "sbuf/SBuf.h"
#include "SquidConfig.h"
#include "StatCounters.h"
Go to the source code of this file.
Functions | |
void | comm_read_base (const Comm::ConnectionPointer &conn, char *buf, int size, AsyncCall::Pointer &callback) |
void | comm_read_cancel (int fd, IOCB *callback, void *data) |
Function Documentation
◆ comm_read_base()
void comm_read_base | ( | const Comm::ConnectionPointer & | conn, |
char * | buf, | ||
int | size, | ||
AsyncCall::Pointer & | callback | ||
) |
Queue a read. If a buffer is given the callback is scheduled when the read completes, on error, or on file descriptor close.
If no buffer (NULL) is given the callback is scheduled when the socket FD is ready for a read(2)/recv(2).
Definition at line 56 of file Read.cc.
References Comm::IoCallback::active(), assert, COMM_SELECT_READ, COMMIO_FD_READCB, commStopHalfClosedMonitor(), Comm::IoCallback::conn, conn, debugs, fd_table, Comm::HandleRead, Comm::IOCB_READ, Comm::IsConnOpen(), Comm::IoCallback::setCallback(), Comm::SetSelect(), and size.
Referenced by comm_read(), and Comm::Read().
◆ comm_read_cancel()
Cancel a pending read. Assert that we have the right parameters, and that there are no pending read events!
XXX: We do not assert that there are no pending read events and with async calls it becomes even more difficult. The whole interface should be reworked to do callback->cancel() instead of searching for places where the callback may be stored and updating the state of those places.
AHC Don't call the comm handlers?
Definition at line 181 of file Read.cc.
References Comm::IoCallback::active(), assert, Comm::IoCallback::callback, Comm::IoCallback::cancel(), COMM_SELECT_READ, COMMIO_FD_READCB, debugs, RefCount< C >::getRaw(), isOpen(), and Comm::SetSelect().
Referenced by IdleConnList::clearHandlers().