]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Utilize comm/forward.h for small pre-definitions
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 8 Jun 2010 14:03:24 +0000 (02:03 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 8 Jun 2010 14:03:24 +0000 (02:03 +1200)
33 files changed:
src/CommCalls.cc
src/CommCalls.h
src/PeerSelectState.h
src/adaptation/icap/Xaction.cc
src/client_side.cc
src/comm.cc
src/comm.h
src/comm/ConnectStateData.cc
src/comm/ConnectStateData.h
src/comm/Connection.cc
src/comm/Connection.h
src/comm/ListenStateData.cc
src/comm/ListenStateData.h
src/comm/Makefile.am
src/comm/forward.h [new file with mode: 0644]
src/dns_internal.cc
src/forward.cc
src/forward.h
src/ftp.cc
src/icp_v2.cc
src/ident/AclIdent.cc
src/ident/Ident.cc
src/ident/Ident.h
src/ipc.cc
src/log/ModTcp.cc
src/log/ModUdp.cc
src/neighbors.cc
src/peer_select.cc
src/protos.h
src/snmp_core.cc
src/tunnel.cc
src/wccp.cc
src/wccp2.cc

index ce5b8028ef12c93df847ba033a7e0c60dc539176..73a65daf91df64e193f0c7e1d5a95becd743fdcb 100644 (file)
@@ -1,5 +1,6 @@
 #include "squid.h"
 #include "fde.h"
+#include "comm/Connection.h"
 #include "CommCalls.h"
 
 /* CommCommonCbParams */
index 9dc02f0f03254e4e716c1a3c499ef69d616a5302..c78c8e6e871ecd479bf7c9382352b519196f02d2 100644 (file)
@@ -6,10 +6,10 @@
 #ifndef SQUID_COMMCALLS_H
 #define SQUID_COMMCALLS_H
 
-#include "comm.h"
-#include "comm/Connection.h"
 #include "base/AsyncCall.h"
 #include "base/AsyncJobCalls.h"
+#include "comm/comm_err_t.h"
+#include "comm/forward.h"
 
 /* CommCalls implement AsyncCall interface for comm_* callbacks.
  * The classes cover two call dialer kinds:
  *     - I/O (IOCB).
  */
 
+typedef void IOACB(int fd, int nfd, Comm::ConnectionPointer details, comm_err_t flag, int xerrno, void *data);
+typedef void CNCB(Comm::ConnectionPointer conn, Comm::PathsPointer paths, comm_err_t status, int xerrno, void *data);
+typedef void IOCB(int fd, char *, size_t size, comm_err_t flag, int xerrno, void *data);
+
 /*
  * TODO: When there are no function-pointer-based callbacks left, all
  * this complexity can be removed. Jobs that need comm services will just
@@ -68,7 +72,7 @@ public:
     void print(std::ostream &os) const;
 
 public:
-    Comm::Connection::Pointer details;
+    Comm::ConnectionPointer details;
     int nfd; // TODO: rename to fdNew or somesuch
 };
 
@@ -83,8 +87,8 @@ public:
     void print(std::ostream &os) const;
 
 public:
-    Comm::Connection::Pointer conn;
-    Vector<Comm::Connection::Pointer> *paths;
+    Comm::ConnectionPointer conn;
+    Comm::PathsPointer paths;
 };
 
 // read/write (I/O) parameters
index e4fb65755f6d7deba6ec680b07f7a84ff0595f05..a84aa6e7c9dba121d4c48f94880fb105f024a40f 100644 (file)
 
 #include "Array.h"
 #include "cbdata.h"
-#include "comm/Connection.h"
+#include "comm/forward.h"
+#include "hier_code.h"
 #include "ip/Address.h"
 #include "PingData.h"
 
 class HttpRequest;
 class StoreEntry;
 
-typedef void PSC(Vector<Comm::Connection::Pointer> *, void *);
+typedef void PSC(Comm::PathsPointer, void *);
 
-SQUIDCEXTERN void peerSelect(Vector<Comm::Connection::Pointer> *, HttpRequest *, StoreEntry *, PSC *, void *data);
+SQUIDCEXTERN void peerSelect(Comm::PathsPointer, HttpRequest *, StoreEntry *, PSC *, void *data);
 SQUIDCEXTERN void peerSelectInit(void);
 
 /**
@@ -78,8 +79,8 @@ public:
     PSC *callback;
     void *callback_data;
 
-    Vector<Comm::Connection::Pointer> *paths;  ///< the callers paths array. to be filled with our final results.
-    FwdServer *servers;                ///< temporary linked list of peers we will pass back.
+    Comm::PathsPointer paths;   ///< the callers paths array. to be filled with our final results.
+    FwdServer *servers;        ///< temporary linked list of peers we will pass back.
 
     /*
      * Why are these Ip::Address instead of peer *?  Because a
index e9cf3c9f29c3e9a62a4ecef2f06dec49975c1e0f..d8ea10f1bf625251686c276d2f2158af89aeb94a 100644 (file)
@@ -116,7 +116,7 @@ void Adaptation::Icap::Xaction::openConnection()
 
     disableRetries(); // we only retry pconn failures
 
-    Comm::Connection::Pointer conn = new Comm::Connection;
+    Comm::ConnectionPointer conn = new Comm::Connection;
 
     // TODO:  where do we get the DNS info for the ICAP server host ??
     //        Ip::Address will do a BLOCKING lookup if s.cfg().host is a hostname
index 09e40afbe1ca07289f622a3951e430e0baf3c3b3..301d017ede0d4a51206119719980b1760483e10b 100644 (file)
@@ -3054,7 +3054,7 @@ connStateCreate(const Ip::Address &peer, const Ip::Address &me, int fd, http_por
 
 /** Handle a new connection on HTTP socket. */
 void
-httpAccept(int sock, int newfd, Comm::Connection::Pointer details,
+httpAccept(int sock, int newfd, Comm::ConnectionPointer details,
            comm_err_t flag, int xerrno, void *data)
 {
     http_port_list *s = (http_port_list *)data;
@@ -3117,7 +3117,7 @@ httpAccept(int sock, int newfd, Comm::Connection::Pointer details,
 
 /** Create SSL connection structure and update fd_table */
 static SSL *
-httpsCreate(int newfd, Comm::Connection::Pointer details, SSL_CTX *sslContext)
+httpsCreate(int newfd, Comm::ConnectionPointer details, SSL_CTX *sslContext)
 {
     SSL *ssl = SSL_new(sslContext);
 
@@ -3260,7 +3260,7 @@ clientNegotiateSSL(int fd, void *data)
 
 /** handle a new HTTPS connection */
 static void
-httpsAccept(int sock, int newfd, Comm::Connection::Pointer details,
+httpsAccept(int sock, int newfd, Comm::ConnectionPointer details,
             comm_err_t flag, int xerrno, void *data)
 {
     https_port_list *s = (https_port_list *)data;
index 5629cda156ca5bccdc1a0629a4794da5b0991ad7..18ca3ae6349d98d520e3696bbf86370796fc2d4b 100644 (file)
@@ -1153,7 +1153,7 @@ comm_close_complete(int fd, void *data)
  * Close the socket fd in use by a connection.
  */
 void
-_comm_close(Comm::Connection::Pointer conn, char const *file, int line)
+_comm_close(Comm::ConnectionPointer conn, char const *file, int line)
 {
     _comm_close(conn->fd, file, line);
     conn->fd = -1;
index 2c452d55d337752440cdee45200fa36be1e83ae8..f7f9a390f0447cebc18411eaa7214db673f1e55f 100644 (file)
@@ -2,20 +2,17 @@
 #define __COMM_H__
 
 #include "squid.h"
-#include "Array.h"
 #include "AsyncEngine.h"
 #include "base/AsyncCall.h"
+#include "CommCalls.h"
 #include "comm/comm_err_t.h"
-#include "comm/Connection.h"
+#include "comm/forward.h"
 #include "ip/Address.h"
 #include "StoreIOBuffer.h"
 
 #define COMMIO_FD_READCB(fd)    (&commfd_table[(fd)].readcb)
 #define COMMIO_FD_WRITECB(fd)   (&commfd_table[(fd)].writecb)
 
-typedef void CNCB(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *paths, comm_err_t status, int xerrno, void *data);
-typedef void IOCB(int fd, char *, size_t size, comm_err_t flag, int xerrno, void *data);
-
 
 /* comm.c */
 extern bool comm_iocallbackpending(void); /* inline candidate */
@@ -25,7 +22,7 @@ SQUIDCEXTERN int commUnsetNonBlocking(int fd);
 SQUIDCEXTERN void commSetCloseOnExec(int fd);
 SQUIDCEXTERN void commSetTcpKeepalive(int fd, int idle, int interval, int timeout);
 extern void _comm_close(int fd, char const *file, int line);
-extern void _comm_close(Comm::Connection::Pointer conn, char const *file, int line);
+extern void _comm_close(Comm::ConnectionPointer conn, char const *file, int line);
 #define comm_close(x) (_comm_close((x), __FILE__, __LINE__))
 SQUIDCEXTERN void comm_reset_close(int fd);
 #if LINGERING_CLOSE
@@ -84,8 +81,7 @@ SQUIDCEXTERN void comm_select_init(void);
 SQUIDCEXTERN comm_err_t comm_select(int);
 SQUIDCEXTERN void comm_quick_poll_required(void);
 
-#include "comm/Connection.h"
-typedef void IOACB(int fd, int nfd, Comm::Connection::Pointer details, comm_err_t flag, int xerrno, void *data);
+//typedef void IOACB(int fd, int nfd, Comm::ConnectionPointer details, comm_err_t flag, int xerrno, void *data);
 extern void comm_add_close_handler(int fd, PF *, void *);
 extern void comm_add_close_handler(int fd, AsyncCall::Pointer &);
 extern void comm_remove_close_handler(int fd, PF *, void *);
index 6ded18815dffa8a398955aa49f41a3938b357d97..65271dc23cf9a0c29dfad7850fb0926fb5dd37ab 100644 (file)
@@ -1,5 +1,6 @@
 #include "config.h"
 #include "comm/ConnectStateData.h"
+#include "comm/Connection.h"
 #include "comm.h"
 #include "CommCalls.h"
 #include "fde.h"
@@ -8,7 +9,7 @@
 
 CBDATA_CLASS_INIT(ConnectStateData);
 
-ConnectStateData::ConnectStateData(Vector<Comm::Connection::Pointer> *paths, AsyncCall::Pointer handler) :
+ConnectStateData::ConnectStateData(Comm::PathsPointer paths, AsyncCall::Pointer handler) :
         host(NULL),
         connect_timeout(Config.Timeout.connect),
         paths(paths),
@@ -19,7 +20,7 @@ ConnectStateData::ConnectStateData(Vector<Comm::Connection::Pointer> *paths, Asy
         connstart(0)
 {}
 
-ConnectStateData::ConnectStateData(Comm::Connection::Pointer c, AsyncCall::Pointer handler) :
+ConnectStateData::ConnectStateData(Comm::ConnectionPointer c, AsyncCall::Pointer handler) :
         host(NULL),
         connect_timeout(Config.Timeout.connect),
         paths(NULL),
@@ -72,7 +73,7 @@ ConnectStateData::callCallback(comm_err_t status, int xerrno)
 void
 ConnectStateData::connect()
 {
-    Comm::Connection::Pointer active;
+    Comm::ConnectionPointer active;
 
     /* handle connecting to one single path */
     /* mainly used by components other than forwarding */
@@ -83,7 +84,7 @@ ConnectStateData::connect()
     if (solo != NULL) {
         active = solo;
     } else if (paths) {
-        Vector<Comm::Connection::Pointer>::iterator i = paths->begin();
+        Comm::Paths::iterator i = paths->begin();
 
         if (connstart == 0) {
             connstart = squid_curtime;
index 72aa1537efcb16eb3378f772f67ceae862095209..bfdce43cfba7fec4c419b3afaf3aacf423dc60dd 100644 (file)
@@ -1,11 +1,10 @@
 #ifndef _SQUID_SRC_COMM_CONNECTSTATEDATA_H
 #define _SQUID_SRC_COMM_CONNECTSTATEDATA_H
 
-#include "Array.h"
 #include "base/AsyncCall.h"
 #include "cbdata.h"
 #include "comm/comm_err_t.h"
-#include "comm/Connection.h"
+#include "comm/forward.h"
 
 /**
  * State engine handling the opening of a remote outbound connection
@@ -15,10 +14,10 @@ class ConnectStateData
 {
 public:
     /** open first working of a set of connections */
-    ConnectStateData(Vector<Comm::Connection::Pointer> *paths, AsyncCall::Pointer handler);
+    ConnectStateData(Comm::PathsPointer paths, AsyncCall::Pointer handler);
 
     /** attempt to open one connection. */
-    ConnectStateData(Comm::Connection::Pointer, AsyncCall::Pointer handler);
+    ConnectStateData(Comm::ConnectionPointer, AsyncCall::Pointer handler);
 
     ~ConnectStateData();
 
@@ -63,9 +62,9 @@ public:
     time_t connect_timeout;
 
 private:
-    Vector<Comm::Connection::Pointer> *paths;  ///< forwarding paths to be tried. front of the list is the current being opened.
-    Comm::Connection::Pointer solo;            ///< single connection currently being opened.
-    AsyncCall::Pointer callback;               ///< handler to be called on connection completion.
+    Comm::PathsPointer paths;           ///< forwarding paths to be tried. front of the list is the current being opened.
+    Comm::ConnectionPointer solo;       ///< single connection currently being opened.
+    AsyncCall::Pointer callback;        ///< handler to be called on connection completion.
 
     int total_tries;   ///< total number of connection attempts over all destinations so far.
     int fail_retries;  ///< number of retries current destination has been tried.
index 29701ddc31392b3db921c06ba6ea290d78d4b226..951dc519c59daa8c695123c4141a160bb903c6ae 100644 (file)
@@ -31,6 +31,8 @@ Comm::Connection::operator =(const Comm::Connection &c)
 
     /* ensure we have a cbdata reference to _peer not a straight ptr copy. */
     _peer = cbdataReference(c._peer);
+
+    return *this;
 }
 
 Comm::Connection::~Connection()
index 0d2a0d8ba05c00691a746eb29cfe4259298f92a3..9c325dc421d8e14bd96f30e04e7e79f233756fd3 100644 (file)
@@ -65,13 +65,11 @@ namespace Comm {
  * outside of the Comm layer code.
  *
  * These objects must not be passed around directly,
- * but a Comm::Connection::Pointer must be passed instead.
+ * but a Comm::ConnectionPointer must be passed instead.
  */
 class Connection : public RefCountable
 {
 public:
-    typedef RefCount<Comm::Connection> Pointer;
-
     /** standard empty connection creation */
     Connection();
 
index 93ae47688a3d5557570e595dca15b8408ab5d1f5..50a1eedb2d6102563eb3e8b98c4b4c5cd9dbb760 100644 (file)
@@ -186,7 +186,7 @@ Comm::ListenStateData::acceptNext()
 }
 
 void
-Comm::ListenStateData::notify(int newfd, comm_err_t errcode, int xerrno, Comm::Connection::Pointer connDetails)
+Comm::ListenStateData::notify(int newfd, comm_err_t errcode, int xerrno, Comm::ConnectionPointer connDetails)
 {
     // listener socket handlers just abandon the port with COMM_ERR_CLOSING
     // it should only happen when this object is deleted...
index a83f8e2ecef461ff03a922f01be1d42433358b74..6372d2f661dda8761711ebb5804bccfb0eda38a6 100644 (file)
@@ -3,7 +3,9 @@
 
 #include "config.h"
 #include "base/AsyncCall.h"
-#include "comm.h"
+#include "comm/comm_err_t.h"
+#include "comm/forward.h"
+
 #if HAVE_MAP
 #include <map>
 #endif
@@ -23,7 +25,7 @@ public:
 
     void subscribe(AsyncCall::Pointer &call);
     void acceptNext();
-    void notify(int newfd, comm_err_t, int xerrno, Comm::Connection::Pointer);
+    void notify(int newfd, comm_err_t, int xerrno, Comm::ConnectionPointer);
 
     int fd;
 
index 9487b38503ce34d635bf2195aceb409151751163..00be9af9252c491bbe1b6b3c9e847b7389e29987 100644 (file)
@@ -18,4 +18,5 @@ libcomm_la_SOURCES= \
        Connection.cc \
        Connection.h \
        comm_err_t.h \
-       comm_internal.h
+       comm_internal.h \
+       forward.h
diff --git a/src/comm/forward.h b/src/comm/forward.h
new file mode 100644 (file)
index 0000000..eb30b5e
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _SQUID_COMM_FORWARD_H
+#define _SQUID_COMM_FORWARD_H
+
+#include "Array.h"
+#include "RefCount.h"
+
+namespace Comm {
+
+class Connection;
+
+typedef RefCount<Comm::Connection> ConnectionPointer;
+
+typedef Vector<Comm::ConnectionPointer> Paths;
+typedef Vector<Comm::ConnectionPointer>* PathsPointer;
+
+}; // namespace Comm
+
+#endif /* _SQUID_COMM_FORWARD_H */
index c963c88fa5930026457cce7bbcc5b9bc90ef6420..dfe7803c29eddf605b071bbf5110086dc0a1dce1 100644 (file)
@@ -699,7 +699,7 @@ idnsDoSendQueryVC(nsvc *vc)
 }
 
 static void
-idnsInitVCConnected(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *unused, comm_err_t status, int xerrno, void *data)
+idnsInitVCConnected(Comm::ConnectionPointer conn, Comm::PathsPointer unused, comm_err_t status, int xerrno, void *data)
 {
     nsvc * vc = (nsvc *)data;
 
@@ -738,7 +738,7 @@ idnsInitVC(int ns)
     vc->msg = new MemBuf;
     vc->busy = 1;
 
-    Comm::Connection::Pointer conn = new Comm::Connection;
+    Comm::ConnectionPointer conn = new Comm::Connection;
 
     if (!Config.Addrs.udp_outgoing.IsNoAddr())
         conn->local = Config.Addrs.udp_outgoing;
index 554da055c57a0a80c8c3686b699513476a0a2f98..a5e3afb83e5529a7b7b65c9be2e2e312bc0563ce 100644 (file)
@@ -35,6 +35,7 @@
 #include "acl/FilledChecklist.h"
 #include "acl/Gadgets.h"
 #include "CacheManager.h"
+#include "comm/Connection.h"
 #include "comm/ConnectStateData.h"
 #include "CommCalls.h"
 #include "event.h"
@@ -360,7 +361,7 @@ FwdState::complete()
 /**** CALLBACK WRAPPERS ************************************************************/
 
 static void
-fwdStartCompleteWrapper(Vector<Comm::Connection::Pointer> *unused, void *data)
+fwdStartCompleteWrapper(Comm::PathsPointer unused, void *data)
 {
     FwdState *fwd = (FwdState *) data;
     fwd->startComplete();
@@ -390,7 +391,7 @@ fwdNegotiateSSLWrapper(int fd, void *data)
 #endif
 
 void
-fwdConnectDoneWrapper(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *paths, comm_err_t status, int xerrno, void *data)
+fwdConnectDoneWrapper(Comm::ConnectionPointer conn, Comm::PathsPointer paths, comm_err_t status, int xerrno, void *data)
 {
     FwdState *fwd = (FwdState *) data;
     fwd->connectDone(conn, paths, status, xerrno);
@@ -663,7 +664,7 @@ FwdState::initiateSSL()
 #endif
 
 void
-FwdState::connectDone(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *result_paths, comm_err_t status, int xerrno)
+FwdState::connectDone(Comm::ConnectionPointer conn, Comm::PathsPointer result_paths, comm_err_t status, int xerrno)
 {
     assert(result_paths == &paths);
 
@@ -740,7 +741,7 @@ FwdState::connectStart()
     if (n_tries == 0) // first attempt
         request->hier.first_conn_start = current_time;
 
-    Comm::Connection::Pointer conn = paths[0];
+    Comm::ConnectionPointer conn = paths[0];
 
     /* connection timeout */
     int ctimeout;
@@ -1075,7 +1076,7 @@ FwdState::reforwardableStatus(http_status s)
  *  -  address of the client for which we made the connection
  */
 void
-FwdState::pconnPush(Comm::Connection::Pointer conn, const peer *_peer, const HttpRequest *req, const char *domain, Ip::Address &client_addr)
+FwdState::pconnPush(Comm::ConnectionPointer conn, const peer *_peer, const HttpRequest *req, const char *domain, Ip::Address &client_addr)
 {
     if (_peer) {
         fwdPconnPool->push(conn->fd, _peer->name, _peer->http_port, domain, client_addr);
@@ -1188,7 +1189,7 @@ aclMapTOS(acl_tos * head, ACLChecklist * ch)
 }
 
 void
-getOutgoingAddress(HttpRequest * request, Comm::Connection::Pointer conn)
+getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn)
 {
     /* skip if an outgoing address is already set. */
     if (!conn->local.IsAnyAddr()) return;
index a5e30a3a2bcb7a1069890d9d072bd7b0092ca28e..7463efc43d7493d277fb4f36cdce202b0a1f2363 100644 (file)
@@ -28,14 +28,14 @@ public:
     bool reforwardableStatus(http_status s);
     void serverClosed(int fd);
     void connectStart();
-    void connectDone(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *paths, comm_err_t status, int xerrno);
+    void connectDone(Comm::ConnectionPointer conn, Comm::PathsPointer paths, comm_err_t status, int xerrno);
     void connectTimeout(int fd);
     void initiateSSL();
     void negotiateSSL(int fd);
     bool checkRetry();
     bool checkRetriable();
     void dispatch();
-    void pconnPush(Comm::Connection::Pointer conn, const peer *_peer, const HttpRequest *req, const char *domain, Ip::Address &client_addr);
+    void pconnPush(Comm::ConnectionPointer conn, const peer *_peer, const HttpRequest *req, const char *domain, Ip::Address &client_addr);
 
     bool dontRetry() { return flags.dont_retry; }
 
@@ -45,7 +45,7 @@ public:
 
     void ftpPasvFailed(bool val) { flags.ftp_pasv_failed = val; }
 
-    Comm::Connection::Pointer conn() const { return paths[0]; };
+    Comm::ConnectionPointer conn() const { return paths[0]; };
 
 private:
     // hidden for safer management of self; use static fwdStart
@@ -89,7 +89,7 @@ private:
     } flags;
 
     /** possible paths which may be tried (in sequence stored) */
-    Vector<Comm::Connection::Pointer> paths;
+    Comm::Paths paths;
 
     // NP: keep this last. It plays with private/public
     CBDATA_CLASS2(FwdState);
index c12131668e2de7c7f3523a99774b7fd89c8c7b3e..edda02653af75a41859f39edcf634158a7b52afb 100644 (file)
@@ -2412,7 +2412,7 @@ ftpReadEPSV(FtpStateData* ftpState)
 
     debugs(9, 3, HERE << "connecting to " << ftpState->data.host << ", port " << ftpState->data.port);
 
-    Comm::Connection::Pointer conn = new Comm::Connection;
+    Comm::ConnectionPointer conn = new Comm::Connection;
     conn->remote = fd_table[ftpState->ctrl.fd].ipaddr; // TODO: do we have a better info source than fd_table?
     conn->remote.SetPort(port);
     conn->fd = fd;
@@ -2697,7 +2697,7 @@ ftpReadPasv(FtpStateData * ftpState)
 
     debugs(9, 3, HERE << "connecting to " << ftpState->data.host << ", port " << ftpState->data.port);
 
-    Comm::Connection::Pointer conn = new Comm::Connection;
+    Comm::ConnectionPointer conn = new Comm::Connection;
     conn->remote = ipaddr;
     conn->remote.SetPort(port);
     conn->fd = ftpState->data.fd;
@@ -2710,7 +2710,7 @@ ftpReadPasv(FtpStateData * ftpState)
 }
 
 void
-FtpStateData::ftpPasvCallback(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *unused, comm_err_t status, int xerrno, void *data)
+FtpStateData::ftpPasvCallback(Comm::ConnectionPointer conn, Comm::PathsPointer unused, comm_err_t status, int xerrno, void *data)
 {
     FtpStateData *ftpState = (FtpStateData *)data;
     debugs(9, 3, HERE);
index 2afd304e893f7bf1857f7c49e6fcc687c6ea16fc..c53738cd43fa2d3bd584caa088d18f9167730d3b 100644 (file)
  */
 
 #include "squid.h"
-#include "Store.h"
-#include "comm.h"
-#include "ICP.h"
-#include "HttpRequest.h"
-#include "acl/FilledChecklist.h"
-#include "acl/Acl.h"
 #include "AccessLogEntry.h"
-#include "wordlist.h"
-#include "SquidTime.h"
-#include "SwapDir.h"
+#include "acl/Acl.h"
+#include "acl/FilledChecklist.h"
+#include "comm/Connection.h"
+#include "HttpRequest.h"
 #include "icmp/net_db.h"
+#include "ICP.h"
 #include "ip/Address.h"
 #include "rfc1738.h"
+#include "Store.h"
+#include "SquidTime.h"
+#include "SwapDir.h"
+#include "wordlist.h"
 
 /// \ingroup ServerProtocolICPInternal2
 static void icpLogIcp(const Ip::Address &, log_type, int, const char *, int);
index 216c40c7d249f0a91f4a8cc4a868ba2f0d5c92bd..2d0b508316fc08f8562197439810535386820b22 100644 (file)
@@ -42,6 +42,7 @@
 #include "acl/RegexData.h"
 #include "acl/UserData.h"
 #include "client_side.h"
+#include "comm/Connection.h"
 #include "ident/AclIdent.h"
 #include "ident/Ident.h"
 
index 7a5e959c05417ad5726fe2af9d00e4d1197fd1f2..5fdf12159a869f7334e927b11d49381891ce0ba7 100644 (file)
@@ -117,7 +117,7 @@ Ident::Timeout(int fd, void *data)
 }
 
 void
-Ident::ConnectDone(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *unused, comm_err_t status, int xerrno, void *data)
+Ident::ConnectDone(Comm::ConnectionPointer conn, Comm::PathsPointer unused, comm_err_t status, int xerrno, void *data)
 {
     IdentStateData *state = (IdentStateData *)data;
 
@@ -217,7 +217,7 @@ CBDATA_TYPE(IdentStateData);
  * start a TCP connection to the peer host on port 113
  */
 void
-Ident::Start(Comm::Connection::Pointer conn, IDCB * callback, void *data)
+Ident::Start(Comm::ConnectionPointer conn, IDCB * callback, void *data)
 {
     IdentStateData *state;
     char key1[IDENT_KEY_SZ];
index 84124ed2e06dfa12c5ea05064426309af97b00e5..623018f4158646fec89e3252794c37b9fe0949a1 100644 (file)
@@ -14,7 +14,7 @@
 #if USE_IDENT
 
 #include "cbdata.h"
-#include "comm/Connection.h"
+#include "comm/forward.h"
 
 namespace Ident
 {
@@ -27,7 +27,7 @@ namespace Ident
  * Self-registers with a global ident lookup manager,
  * will call Ident::Init() itself if the manager has not been initialized already.
  */
-void Start(Comm::Connection::Pointer conn, IDCB * callback, void *cbdata);
+void Start(Comm::ConnectionPointer conn, IDCB * callback, void *cbdata);
 
 /**
  \ingroup IdentAPI
index 5336b3d12dab636241b7e82bd3de972fdbc3e659..5ecc9e2145dab1cc2b331b8fd94f085d5e655f9b 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 #include "squid.h"
-#include "comm.h"
+#include "comm/Connection.h"
 #include "fde.h"
 #include "ip/Address.h"
 #include "rfc1738.h"
index 8fef05145975344394d6af2465753c645be20cd6..c56ea0f96ed32783c0d902eca12c5a7ae5f1df4d 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "squid.h"
 #include "comm.h"
+#include "comm/Connection.h"
 #include "log/File.h"
 #include "log/ModTcp.h"
 #include "Parsing.h"
index bc83cf4df0a4160b2989a7a52781f5a527dfdb05..3310e32c1aa0d9aeac489260fe693000cc0bb21e 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "squid.h"
 #include "comm.h"
+#include "comm/Connection.h"
 #include "log/File.h"
 #include "log/ModUdp.h"
 #include "Parsing.h"
index 532719139f873efd4a3d2b7b0a411809fbdfea83..82ea74e03332b0386c65b96daa9af76aa043ad26 100644 (file)
@@ -1359,9 +1359,9 @@ peerProbeConnect(peer * p)
         return ret;/* don't probe to often */
 
     /* for each IP address of this peer. find one that we can connect to and probe it. */
-    Vector<Comm::Connection::Pointer> *paths = new Vector<Comm::Connection::Pointer>;
+    Comm::PathsPointer paths = new Comm::Paths;
     for (int i = 0; i < p->n_addresses; i++) {
-        Comm::Connection::Pointer conn = new Comm::Connection;
+        Comm::ConnectionPointer conn = new Comm::Connection;
         conn->remote = p->addresses[i];
         conn->remote.SetPort(p->http_port);
         getOutgoingAddress(NULL, conn);
@@ -1381,7 +1381,7 @@ peerProbeConnect(peer * p)
 }
 
 static void
-peerProbeConnectDone(Comm::Connection::Pointer conn, Vector<Comm::Connection::Pointer> *unused, comm_err_t status, int xerrno, void *data)
+peerProbeConnectDone(Comm::ConnectionPointer conn, Comm::PathsPointer unused, comm_err_t status, int xerrno, void *data)
 {
     peer *p = (peer*)data;
 
index b51ff16f755510536c55c0df50cd637b214062e9..b4088c8d3550c5b9a556a96bf36c996239ded1a7 100644 (file)
@@ -124,7 +124,7 @@ peerSelectIcpPing(HttpRequest * request, int direct, StoreEntry * entry)
 
 
 void
-peerSelect(Vector<Comm::Connection::Pointer> *paths,
+peerSelect(Comm::PathsPointer paths,
            HttpRequest * request,
            StoreEntry * entry,
            PSC * callback,
@@ -253,7 +253,7 @@ peerSelectDnsResults(const ipcache_addrs *ia, const DnsLookupDetails &details, v
         assert(ia->cur < ia->count);
 
         // loop over each result address, adding to the possible destinations.
-        Comm::Connection::Pointer p;
+        Comm::ConnectionPointer p;
         int ip = ia->cur;
         for (int n = 0; n < ia->count; n++, ip++) {
             if (ip >= ia->count) ip = 0; // looped back to zero.
index fe2d6b94772553b6cb2629bfb485c95e7f9036ae..e8a15b19b14ff026ffc36807da424d6124311a82 100644 (file)
@@ -405,8 +405,8 @@ SQUIDCEXTERN void peerDigestNeeded(PeerDigest * pd);
 SQUIDCEXTERN void peerDigestNotePeerGone(PeerDigest * pd);
 SQUIDCEXTERN void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
 
-#include "comm/Connection.h"
-extern void getOutgoingAddress(HttpRequest * request, Comm::Connection::Pointer conn);
+#include "comm/forward.h"
+extern void getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn);
 unsigned long getOutgoingTOS(HttpRequest * request);
 
 SQUIDCEXTERN void urnStart(HttpRequest *, StoreEntry *);
index 8e6adaf494f5a1ccdcef4e324c5cf9436d5d8a2d..dec9c8aa11553b9326c7f3b693da2818d63cca86 100644 (file)
@@ -33,6 +33,7 @@
 #include "acl/FilledChecklist.h"
 #include "cache_snmp.h"
 #include "comm.h"
+#include "comm/Connection.h"
 #include "compat/strsep.h"
 #include "ip/Address.h"
 
index 41b965171de067edec5dd89b9018bae226a82240..eb887bc20a8d6dd255512ad5ca43adeeaf81fa0e 100644 (file)
@@ -68,7 +68,7 @@ public:
     char *host;                        /* either request->host or proxy host */
     u_short port;
     HttpRequest *request;
-    Vector<Comm::Connection::Pointer> *paths;
+    Comm::PathsPointer paths;
 
     class Connection
     {
@@ -558,12 +558,12 @@ tunnelErrorComplete(int fdnotused, void *data, size_t sizenotused)
 
 
 static void
-tunnelConnectDone(Comm::Connection::Pointer unused, Vector<Comm::Connection::Pointer> *paths, comm_err_t status, int xerrno, void *data)
+tunnelConnectDone(Comm::ConnectionPointer unused, Comm::PathsPointer paths, comm_err_t status, int xerrno, void *data)
 {
     TunnelStateData *tunnelState = (TunnelStateData *)data;
     HttpRequest *request = tunnelState->request;
     ErrorState *err = NULL;
-    Comm::Connection::Pointer conn = (*paths)[0];
+    Comm::ConnectionPointer conn = (*paths)[0];
 
     assert(tunnelState->paths == paths);
 
@@ -713,7 +713,7 @@ tunnelProxyConnected(int fd, void *data)
 }
 
 static void
-tunnelPeerSelectComplete(Vector<Comm::Connection::Pointer> *peer_paths, void *data)
+tunnelPeerSelectComplete(Comm::PathsPointer peer_paths, void *data)
 {
     TunnelStateData *tunnelState = (TunnelStateData *)data;
     HttpRequest *request = tunnelState->request;
index 9f0f5147987feac0137ea8f5eb3a19abf80b5138..86a8fe49dc782585a7ed8ebc75553214eb94e871 100644 (file)
  *
  */
 #include "squid.h"
-#include "comm.h"
-#include "event.h"
 
 #if USE_WCCP
 
+#include "comm.h"
+#include "comm/Connection.h"
+#include "event.h"
+
 #define WCCP_PORT 2048
 #define WCCP_REVISION 0
 #define WCCP_ACTIVE_CACHES 32
index d4769339d0d2583c96024a39476c097a70543a4b..199d7e9624346f64aaae132c690282721f09a43b 100644 (file)
@@ -35,6 +35,7 @@
 #if USE_WCCPv2
 
 #include "comm.h"
+#include "comm/Connection.h"
 #include "compat/strsep.h"
 #include "event.h"
 #include "ip/Address.h"