58 debugs(5, 5,
"comm_read, queueing read for " << conn <<
"; asynCall " << callback);
86 if (params.
size > 0 && params.
size < sz)
93 debugs(5, 3, params.
conn <<
", size " << sz <<
", retval " << retval <<
", errno " << params.
xerrno);
101 }
else if (retval == 0) {
106 }
else if (retval < 0) {
145 int xerrno = errno = 0;
148 debugs(5, 3,
"FD " << fd <<
", size " << ccb->
size <<
", retval " << retval <<
", errno " << xerrno);
158 debugs(5, 3,
"comm_read_try: scheduling Comm::COMM_ERROR");
184 debugs(5, 4,
"fails: FD " << fd <<
" closed");
191 debugs(5, 4,
"fails: FD " << fd <<
" inactive");
198 debugs(5, 4,
"fails: FD " << fd <<
" lacks callback");
202 call->cancel(
"old comm_read_cancel");
205 const Params ¶ms = GetCommParams<Params>(cb->
callback);
208 assert(call->dialer.handler == callback);
209 assert(params.data == data);
212 cb->
cancel(
"old comm_read_cancel");
221 callback->
cancel(
"comm_read_cancel");
224 debugs(5, 4,
"fails: FD " << fd <<
" closed");
231 debugs(5, 4,
"fails: FD " << fd <<
" inactive");
241 cb->
cancel(
"comm_read_cancel");
250 if (lifetimeLimit > 0) {
252 const time_t timeLeft = (lifetimeLimit > timeUsed) ? (lifetimeLimit - timeUsed) : 0;
255 return ::Config.Timeout.read;
void IOCB(const Comm::ConnectionPointer &conn, char *, size_t size, Comm::Flag flag, int xerrno, void *data)
#define COMMIO_FD_READCB(fd)
void comm_read_cancel(int fd, IOCB *callback, void *data)
void comm_read_base(const Comm::ConnectionPointer &conn, char *buf, int size, AsyncCall::Pointer &callback)
bool cancel(const char *reason)
int xerrno
The last errno to occur. non-zero if flag is Comm::COMM_ERROR.
Comm::Flag flag
comm layer result status.
Comm::ConnectionPointer conn
Details about a particular Comm IO callback event.
void setCallback(iocb_type type, AsyncCall::Pointer &cb, char *buf, FREE *func, int sz)
AsyncCall::Pointer callback
void finish(Comm::Flag code, int xerrn)
finish the IO operation immediately and schedule the callback with the current state.
void cancel(const char *reason)
Actively cancel the given callback.
Comm::ConnectionPointer conn
char * rawAppendStart(size_type anticipatedSize)
size_type spaceSize() const
MemBlob::size_type size_type
void rawAppendFinish(const char *start, size_type actualSize)
struct StatCounters::@112 syscalls
struct StatCounters::@112::@117 sock
void commStopHalfClosedMonitor(int const fd)
stop waiting for possibly half-closed connection to close
int ignoreErrno(int ierrno)
bool isOpen(const int fd)
A const & min(A const &lhs, A const &rhs)
#define debugs(SECTION, LEVEL, CONTENT)
void fd_bytes(const int fd, const int len, const IoDirection direction)
int FD_READ_METHOD(int fd, char *buf, int len)
bool MonitorsRead(int fd)
whether the FD socket is being monitored for read
void ReadCancel(int fd, AsyncCall::Pointer &callback)
Cancel the read pending on FD. No action if none pending.
void Read(const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback)
bool IsConnOpen(const Comm::ConnectionPointer &conn)
time_t MortalReadTimeout(const time_t startTime, const time_t lifetimeLimit)
maximum read delay for readers with limited lifetime
PF HandleRead
callback handler to process an FD which is available for reading
void SetSelect(int, unsigned int, PF *, void *, time_t)
Mark an FD to be watched for its IO status.
Comm::Flag ReadNow(CommIoCbParams ¶ms, SBuf &buf)
const char * xstrerr(int error)