]> git.ipfire.org Git - thirdparty/squid.git/blame - src/comm/Write.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / comm / Write.h
CommitLineData
bbc27441 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
bbc27441
AJ
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
ec41b64c
AJ
9#ifndef _SQUID_COMM_IOWRITE_H
10#define _SQUID_COMM_IOWRITE_H
11
12#include "base/AsyncCall.h"
b0388924 13#include "comm/forward.h"
6f5dc9e4 14#include "mem/forward.h"
ec41b64c 15
582c2af2 16class MemBuf;
f31be4b0
A
17namespace Comm
18{
ec41b64c
AJ
19
20/**
21 * Queue a write. callback is scheduled when the write
22 * completes, on error, or on file descriptor close.
23 *
24 * free_func is used to free the passed buffer when the write has completed.
25 */
b0388924 26void Write(const Comm::ConnectionPointer &conn, const char *buf, int size, AsyncCall::Pointer &callback, FREE *free_func);
ec41b64c
AJ
27
28/**
29 * Queue a write. callback is scheduled when the write
30 * completes, on error, or on file descriptor close.
31 */
b0388924 32void Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback);
ec41b64c
AJ
33
34/// Cancel the write pending on FD. No action if none pending.
b0388924 35void WriteCancel(const Comm::ConnectionPointer &conn, const char *reason);
ec41b64c 36
e5519212 37} // namespace Comm
ec41b64c
AJ
38
39#endif /* _SQUID_COMM_IOWRITE_H */
f53969cc 40