]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/comm/Write.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / comm / Write.h
index 1d5dcdff9215b86b891ae199b58133e6524fae37..2f3625c9d450499c3a26bdfbacc7b40e88120398 100644 (file)
@@ -1,9 +1,21 @@
+/*
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef _SQUID_COMM_IOWRITE_H
 #define _SQUID_COMM_IOWRITE_H
 
 #include "base/AsyncCall.h"
+#include "comm/forward.h"
+#include "mem/forward.h"
 
-namespace Comm {
+class MemBuf;
+namespace Comm
+{
 
 /**
  * Queue a write. callback is scheduled when the write
@@ -11,20 +23,18 @@ namespace Comm {
  *
  * free_func is used to free the passed buffer when the write has completed.
  */
-void Write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE *free_func);
+void Write(const Comm::ConnectionPointer &conn, const char *buf, int size, AsyncCall::Pointer &callback, FREE *free_func);
 
 /**
  * Queue a write. callback is scheduled when the write
  * completes, on error, or on file descriptor close.
  */
-void Write(int fd, MemBuf *mb, AsyncCall::Pointer &callback);
+void Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback);
 
 /// Cancel the write pending on FD. No action if none pending.
-void WriteCancel(int fd, const char *reason);
-
-// callback handler to process an FD which is available for writing.
-extern PF HandleWrite;
+void WriteCancel(const Comm::ConnectionPointer &conn, const char *reason);
 
 } // namespace Comm
 
 #endif /* _SQUID_COMM_IOWRITE_H */
+