]> git.ipfire.org Git - thirdparty/squid.git/blob - src/comm/Write.h
Merged from trunk
[thirdparty/squid.git] / src / comm / Write.h
1 #ifndef _SQUID_COMM_IOWRITE_H
2 #define _SQUID_COMM_IOWRITE_H
3
4 #include "base/AsyncCall.h"
5 #include "comm/forward.h"
6
7 namespace Comm
8 {
9
10 /**
11 * Queue a write. callback is scheduled when the write
12 * completes, on error, or on file descriptor close.
13 *
14 * free_func is used to free the passed buffer when the write has completed.
15 */
16 void Write(const Comm::ConnectionPointer &conn, const char *buf, int size, AsyncCall::Pointer &callback, FREE *free_func);
17
18 /**
19 * Queue a write. callback is scheduled when the write
20 * completes, on error, or on file descriptor close.
21 */
22 void Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback);
23
24 /// Cancel the write pending on FD. No action if none pending.
25 void WriteCancel(const Comm::ConnectionPointer &conn, const char *reason);
26
27 // callback handler to process an FD which is available for writing.
28 extern PF HandleWrite;
29
30 } // namespace Comm
31
32 #endif /* _SQUID_COMM_IOWRITE_H */