Read.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef SQUID_SRC_COMM_READ_H
10 #define SQUID_SRC_COMM_READ_H
11 
12 #include "base/AsyncCall.h"
13 #include "comm/forward.h"
14 #include "CommCalls.h"
15 #include "sbuf/forward.h"
16 
17 namespace Comm
18 {
19 
26 void Read(const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback);
27 
29 bool MonitorsRead(int fd);
30 
45 Comm::Flag ReadNow(CommIoCbParams &params, SBuf &buf);
46 
48 void ReadCancel(int fd, AsyncCall::Pointer &callback);
49 
51 extern PF HandleRead;
52 
54 time_t MortalReadTimeout(const time_t startTime, const time_t lifetimeLimit);
55 } // namespace Comm
56 
57 // Legacy API to be removed
58 void comm_read_base(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback);
59 inline void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback)
60 {
61  assert(buf != nullptr);
62  comm_read_base(conn, buf, len, callback);
63 }
64 void comm_read_cancel(int fd, IOCB *callback, void *data);
65 
66 #endif /* SQUID_SRC_COMM_READ_H */
67 
void Read(const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback)
Definition: Read.cc:40
void comm_read_base(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback)
Definition: Read.cc:56
bool MonitorsRead(int fd)
whether the FD socket is being monitored for read
Definition: Read.cc:29
Comm::Flag ReadNow(CommIoCbParams &params, SBuf &buf)
Definition: Read.cc:81
Definition: SBuf.h:93
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:16
void ReadCancel(int fd, AsyncCall::Pointer &callback)
Cancel the read pending on FD. No action if none pending.
Definition: Read.cc:219
void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer &callback)
Definition: Read.h:59
PF HandleRead
callback handler to process an FD which is available for reading
Definition: Read.cc:128
void IOCB(const Comm::ConnectionPointer &conn, char *, size_t size, Comm::Flag flag, int xerrno, void *data)
Definition: CommCalls.h:34
#define assert(EX)
Definition: assert.h:17
void comm_read_cancel(int fd, IOCB *callback, void *data)
Definition: Read.cc:181
Flag
Definition: Flag.h:15
time_t MortalReadTimeout(const time_t startTime, const time_t lifetimeLimit)
maximum read delay for readers with limited lifetime
Definition: Read.cc:248
void PF(int, void *)
Definition: forward.h:18

 

Introduction

Documentation

Support

Miscellaneous