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