]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/comm/IoCallback.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / comm / IoCallback.h
index 9ce281a0ec431ace0cea377ce2264c7a88bb69c0..b97ca72965ab8bb61d3a7d0eef0e8b8f8305278c 100644 (file)
@@ -1,9 +1,20 @@
+/*
+ * Copyright (C) 1996-2015 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_IOCALLBACK_H
 #define _SQUID_COMM_IOCALLBACK_H
 
-#include "config.h"
 #include "base/AsyncCall.h"
-#include "comm_err_t.h"
+#include "comm/Flag.h"
+#include "comm/forward.h"
+#include "typedefs.h"
+
+class SBuf;
 
 namespace Comm
 {
@@ -20,13 +31,13 @@ class IoCallback
 {
 public:
     iocb_type type;
-    int fd;
+    Comm::ConnectionPointer conn;
     AsyncCall::Pointer callback;
     char *buf;
     FREE *freefunc;
     int size;
     int offset;
-    comm_err_t errcode;
+    Comm::Flag errcode;
     int xerrno;
 #if USE_DELAY_POOLS
     unsigned int quotaQueueReserv; ///< reservation ID from CommQuotaQueue
@@ -42,7 +53,7 @@ public:
     void cancel(const char *reason);
 
     /// finish the IO operation imediately and schedule the callback with the current state.
-    void finish(comm_err_t code, int xerrn);
+    void finish(Comm::Flag code, int xerrn);
 
 private:
     void reset();
@@ -62,8 +73,8 @@ public:
 /// Callbacks which might be scheduled in future are stored in fd_table.
 extern CbEntry *iocb_table;
 
-extern void CallbackTableInit();
-extern void CallbackTableDestruct();
+void CallbackTableInit();
+void CallbackTableDestruct();
 
 #define COMMIO_FD_READCB(fd)    (&Comm::iocb_table[(fd)].readcb)
 #define COMMIO_FD_WRITECB(fd)   (&Comm::iocb_table[(fd)].writecb)
@@ -71,3 +82,4 @@ extern void CallbackTableDestruct();
 } // namespace Comm
 
 #endif /* _SQUID_COMM_IOCALLBACK_H */
+