]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Applied source formatting rules in preparation for trunk merge.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Jul 2010 18:58:38 +0000 (12:58 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Jul 2010 18:58:38 +0000 (12:58 -0600)
21 files changed:
src/client_side.cc
src/comm.cc
src/debug.cc
src/htcp.cc
src/icp_v2.cc
src/ipc/Coordinator.cc
src/ipc/FdNotes.h
src/ipc/Kid.cc
src/ipc/Messages.h
src/ipc/Port.cc
src/ipc/SharedListen.cc
src/ipc/StartListening.cc
src/ipc/StartListening.h
src/ipc/Strand.cc
src/ipc/TypedMsgHdr.cc
src/ipc/TypedMsgHdr.h
src/ipc/UdsOp.cc
src/ipc/UdsOp.h
src/main.cc
src/protos.h
src/snmp_core.cc

index 33ed26e62f29ae954dac2455f19f7f34d99eb577..228c6fb7cff9a33ee2c70afffe244cc218f2aa20 100644 (file)
@@ -120,10 +120,12 @@ class ListeningStartedDialer: public CallDialer, public Ipc::StartListeningCb
 public:
     typedef void (*Handler)(int fd, int errNo, http_port_list *portCfg);
     ListeningStartedDialer(Handler aHandler, http_port_list *aPortCfg):
-        handler(aHandler), portCfg(aPortCfg) {}
+            handler(aHandler), portCfg(aPortCfg) {}
 
-    virtual void print(std::ostream &os) const { startPrint(os) <<
-        ", port=" << (void*)portCfg << ')'; }
+    virtual void print(std::ostream &os) const {
+        startPrint(os) <<
+        ", port=" << (void*)portCfg << ')';
+    }
 
     virtual bool canDial(AsyncCall &) const { return true; }
     virtual void dial(AsyncCall &) { (handler)(fd, errNo, portCfg); }
@@ -3414,13 +3416,13 @@ clientHttpConnectionsOpen(void)
         /* AYJ: 2009-12-27: bit bumpy. new ListenStateData(...) should be doing all the Comm:: stuff ... */
 
         const int openFlags = COMM_NONBLOCKING |
-            (s->spoof_client_ip ? COMM_TRANSPARENT : 0);
+                              (s->spoof_client_ip ? COMM_TRANSPARENT : 0);
 
         AsyncCall::Pointer callback = asyncCall(33,2,
-            "clientHttpConnectionOpened",
-            ListeningStartedDialer(&clientHttpConnectionOpened, s));
+                                                "clientHttpConnectionOpened",
+                                                ListeningStartedDialer(&clientHttpConnectionOpened, s));
         Ipc::StartListening(SOCK_STREAM, IPPROTO_TCP, s->s, openFlags,
-            Ipc::fdnHttpSocket, callback);
+                            Ipc::fdnHttpSocket, callback);
 
         HttpSockets[NHttpSockets++] = -1; // set in clientHttpConnectionOpened
     }
@@ -3442,18 +3444,18 @@ clientHttpConnectionOpened(int fd, int, http_port_list *s)
 
     Must(s);
 
-        AsyncCall::Pointer call = commCbCall(5,5, "SomeCommAcceptHandler(httpAccept)",
-                                             CommAcceptCbPtrFun(httpAccept, s));
+    AsyncCall::Pointer call = commCbCall(5,5, "SomeCommAcceptHandler(httpAccept)",
+                                         CommAcceptCbPtrFun(httpAccept, s));
 
-        s->listener = new Comm::ListenStateData(fd, call, true);
+    s->listener = new Comm::ListenStateData(fd, call, true);
 
-        debugs(1, 1, "Accepting " <<
-               (s->intercepted ? " intercepted" : "") <<
-               (s->spoof_client_ip ? " spoofing" : "") <<
-               (s->sslBump ? " bumpy" : "") <<
-               (s->accel ? " accelerated" : "")
-               << " HTTP connections at " << s->s
-               << ", FD " << fd << "." );
+    debugs(1, 1, "Accepting " <<
+           (s->intercepted ? " intercepted" : "") <<
+           (s->spoof_client_ip ? " spoofing" : "") <<
+           (s->sslBump ? " bumpy" : "") <<
+           (s->accel ? " accelerated" : "")
+           << " HTTP connections at " << s->s
+           << ", FD " << fd << "." );
 
     Must(AddOpenedHttpSocket(fd)); // otherwise, we have received a fd we did not ask for
 }
@@ -3478,10 +3480,10 @@ clientHttpsConnectionsOpen(void)
         }
 
         AsyncCall::Pointer call = asyncCall(33, 2, "clientHttpsConnectionOpened",
-            ListeningStartedDialer(&clientHttpsConnectionOpened, &s->http));
+                                            ListeningStartedDialer(&clientHttpsConnectionOpened, &s->http));
 
         Ipc::StartListening(SOCK_STREAM, IPPROTO_TCP, s->http.s, COMM_NONBLOCKING,
-            Ipc::fdnHttpsSocket, call);
+                            Ipc::fdnHttpsSocket, call);
 
         HttpSockets[NHttpSockets++] = -1;
     }
@@ -3496,12 +3498,12 @@ clientHttpsConnectionOpened(int fd, int, http_port_list *s)
 
     Must(s);
 
-        AsyncCall::Pointer call = commCbCall(5,5, "SomeCommAcceptHandler(httpsAccept)",
-                                             CommAcceptCbPtrFun(httpsAccept, s));
+    AsyncCall::Pointer call = commCbCall(5,5, "SomeCommAcceptHandler(httpsAccept)",
+                                         CommAcceptCbPtrFun(httpsAccept, s));
 
-        s->listener = new Comm::ListenStateData(fd, call, true);
+    s->listener = new Comm::ListenStateData(fd, call, true);
 
-        debugs(1, 1, "Accepting HTTPS connections at " << s->s << ", FD " << fd << ".");
+    debugs(1, 1, "Accepting HTTPS connections at " << s->s << ", FD " << fd << ".");
 
     Must(AddOpenedHttpSocket(fd)); // otherwise, we have received a fd we did not ask for
 }
index 06ba71adf8802f3f8a0375463e6d4693491d93a5..475d167bf6beac575f35375ffb7ebb5fc5d6e385 100644 (file)
@@ -757,10 +757,10 @@ comm_openex(int sock_type,
 /// update FD tables after a local or remote (IPC) comm_openex();
 void
 comm_init_opened(int new_socket,
-            IpAddress &addr,
-            unsigned char TOS,
-            const char *note,
-            struct addrinfo *AI)
+                 IpAddress &addr,
+                 unsigned char TOS,
+                 const char *note,
+                 struct addrinfo *AI)
 {
     assert(new_socket >= 0);
     assert(AI);
@@ -790,9 +790,9 @@ comm_init_opened(int new_socket,
 /// returns new_socket or -1 on error
 static int
 comm_apply_flags(int new_socket,
-            IpAddress &addr,
-            int flags,
-            struct addrinfo *AI)
+                 IpAddress &addr,
+                 int flags,
+                 struct addrinfo *AI)
 {
     assert(new_socket >= 0);
     assert(AI);
@@ -851,10 +851,10 @@ comm_apply_flags(int new_socket,
 
 void
 comm_import_opened(int fd,
-            IpAddress &addr,
-            int flags,
-            const char *note,
-            struct addrinfo *AI)
+                   IpAddress &addr,
+                   int flags,
+                   const char *note,
+                   struct addrinfo *AI)
 {
     debugs(5, 2, HERE << " FD " << fd << " at " << addr);
     assert(fd >= 0);
index edcaf70120e7722673173f6a6a156b4785fa32ec..1e60987ca44ae6984dd891756de0dc502ad8cd85 100644 (file)
@@ -550,10 +550,10 @@ static const char *
 debugLogKid(void)
 {
     if (KidIdentifier != 0) {
-               static char buf[16];
+        static char buf[16];
         if (!*buf) // optimization: fill only once after KidIdentifier is set
             snprintf(buf, sizeof(buf), " kid%d", KidIdentifier);
-               return buf;
+        return buf;
     }
 
     return "";
index ab76d6678d61d1093fab165be3d1713fe556a35a..2e261aa295babb204dd3974d28a4ea73bbd503e4 100644 (file)
@@ -50,7 +50,7 @@
 
 /// dials htcpIncomingConnectionOpened call
 class HtcpListeningStartedDialer: public CallDialer,
-    public Ipc::StartListeningCb
+        public Ipc::StartListeningCb
 {
 public:
     typedef void (*Handler)(int fd, int errNo);
@@ -1504,14 +1504,14 @@ htcpInit(void)
     incomingAddr.SetPort(Config.Port.htcp);
 
     AsyncCall::Pointer call = asyncCall(31, 2,
-        "htcpIncomingConnectionOpened",
-        HtcpListeningStartedDialer(&htcpIncomingConnectionOpened));
+                                        "htcpIncomingConnectionOpened",
+                                        HtcpListeningStartedDialer(&htcpIncomingConnectionOpened));
 
     Ipc::StartListening(SOCK_DGRAM,
-                                      IPPROTO_UDP,
-                                      incomingAddr,
-                                      COMM_NONBLOCKING,
-                                      Ipc::fdnInHtcpSocket, call);
+                        IPPROTO_UDP,
+                        incomingAddr,
+                        COMM_NONBLOCKING,
+                        Ipc::fdnInHtcpSocket, call);
 
     if (!Config.Addrs.udp_outgoing.IsNoAddr()) {
         IpAddress outgoingAddr = Config.Addrs.udp_outgoing;
index fbd600b20e30512b58f00253303c3b311c2f7ea4..67bd9788820b8822aa8793fe7eb6c6bd20620c34 100644 (file)
 
 /// dials icpIncomingConnectionOpened call
 class IcpListeningStartedDialer: public CallDialer,
-    public Ipc::StartListeningCb
+        public Ipc::StartListeningCb
 {
 public:
     typedef void (*Handler)(int fd, int errNo, IpAddress& addr);
     IcpListeningStartedDialer(Handler aHandler, IpAddress& anAddr):
-        handler(aHandler), addr(anAddr) {}
+            handler(aHandler), addr(anAddr) {}
 
-    virtual void print(std::ostream &os) const { startPrint(os) <<
-        ", address=" << addr << ')'; }
+    virtual void print(std::ostream &os) const {
+        startPrint(os) <<
+        ", address=" << addr << ')';
+    }
 
     virtual bool canDial(AsyncCall &) const { return true; }
     virtual void dial(AsyncCall &) { (handler)(fd, errNo, addr); }
@@ -687,14 +689,14 @@ icpConnectionsOpen(void)
     addr.SetPort(port);
 
     AsyncCall::Pointer call = asyncCall(12, 2,
-        "icpIncomingConnectionOpened",
-        IcpListeningStartedDialer(&icpIncomingConnectionOpened, addr));
+                                        "icpIncomingConnectionOpened",
+                                        IcpListeningStartedDialer(&icpIncomingConnectionOpened, addr));
 
     Ipc::StartListening(SOCK_DGRAM,
-                                            IPPROTO_UDP,
-                                            addr,
-                                            COMM_NONBLOCKING,
-                                            Ipc::fdnInIcpSocket, call);
+                        IPPROTO_UDP,
+                        addr,
+                        COMM_NONBLOCKING,
+                        Ipc::fdnInIcpSocket, call);
 
     addr.SetEmpty(); // clear for next use.
     addr = Config.Addrs.udp_outgoing;
@@ -755,7 +757,7 @@ icpIncomingConnectionOpened(int fd, int errNo, IpAddress& addr)
 
     debugs(12, 1, "Accepting ICP messages at " << addr << ", FD " << theInIcpConnection << ".");
 
-        fd_note(theInIcpConnection, "Incoming ICP socket");
+    fd_note(theInIcpConnection, "Incoming ICP socket");
 
     if (Config.Addrs.udp_outgoing.IsNoAddr())
         theOutIcpConnection = theInIcpConnection;
index 47ecf7ccfd4f563dd328067d14e22b58a82e947f..a714330e3180393126a3686ffdb6b9fce8a7d082 100644 (file)
@@ -18,7 +18,7 @@ Ipc::Coordinator* Ipc::Coordinator::TheInstance = NULL;
 
 
 Ipc::Coordinator::Coordinator():
-    Port(coordinatorAddr)
+        Port(coordinatorAddr)
 {
 }
 
@@ -78,15 +78,15 @@ void
 Ipc::Coordinator::handleSharedListenRequest(const SharedListenRequest& request)
 {
     debugs(54, 4, HERE << "kid" << request.requestorId <<
-        " needs shared listen FD for " << request.params.addr);
+           " needs shared listen FD for " << request.params.addr);
     Listeners::const_iterator i = listeners.find(request.params);
     int errNo = 0;
     const int sock = (i != listeners.end()) ?
-        i->second : openListenSocket(request, errNo);
+                     i->second : openListenSocket(request, errNo);
 
     debugs(54, 3, HERE << "sending shared listen FD " << sock << " for " <<
-        request.params.addr << " to kid" << request.requestorId <<
-        " mapId=" << request.mapId);
+           request.params.addr << " to kid" << request.requestorId <<
+           " mapId=" << request.mapId);
 
     SharedListenResponse response(sock, errNo, request.mapId);
     TypedMsgHdr message;
@@ -96,18 +96,18 @@ Ipc::Coordinator::handleSharedListenRequest(const SharedListenRequest& request)
 
 int
 Ipc::Coordinator::openListenSocket(const SharedListenRequest& request,
-        int &errNo)
+                                   int &errNo)
 {
     const OpenListenerParams &p = request.params;
 
     debugs(54, 6, HERE << "opening listen FD at " << p.addr << " for kid" <<
-        request.requestorId);
+           request.requestorId);
 
     IpAddress addr = p.addr; // comm_open_listener may modify it
 
     enter_suid();
     const int sock = comm_open_listener(p.sock_type, p.proto, addr, p.flags,
-        FdNote(p.fdNote));
+                                        FdNote(p.fdNote));
     errNo = (sock >= 0) ? 0 : errno;
     leave_suid();
 
@@ -123,7 +123,7 @@ void Ipc::Coordinator::broadcastSignal(int sig) const
     typedef Strands::const_iterator SCI;
     for (SCI iter = strands.begin(); iter != strands.end(); ++iter) {
         debugs(54, 5, HERE << "signal " << sig << " to kid" << iter->kidId <<
-            ", PID=" << iter->pid);
+               ", PID=" << iter->pid);
         kill(iter->pid, sig);
     }
 }
index 87219d09bc6d1741244897a45a9ecc7665d34d05..91409d0e72a94db3302d9c6493167f41a20ef098 100644 (file)
@@ -15,8 +15,9 @@ namespace Ipc
 
 /// fd_note() label ID
 typedef enum { fdnNone, fdnHttpSocket, fdnHttpsSocket,
-               fdnInSnmpSocket, fdnOutSnmpSocket, 
-               fdnInIcpSocket, fdnInHtcpSocket, fdnEnd } FdNoteId;
+               fdnInSnmpSocket, fdnOutSnmpSocket,
+               fdnInIcpSocket, fdnInHtcpSocket, fdnEnd
+             } FdNoteId;
 
 extern const char *FdNote(int fdNodeId); ///< converts FdNoteId into a string
 
index 8150fee41ac4354fd9614b4a5c9280bac2d7fef4..f6f5d1ccf7ccdc4e78e987a6fdfc80f027e2c6a8 100644 (file)
@@ -9,19 +9,19 @@
 #include "ipc/Kid.h"
 
 Kid::Kid():
-    badFailures(0),
-    pid(-1),
-    startTime(0),
-    isRunning(false)
+        badFailures(0),
+        pid(-1),
+        startTime(0),
+        isRunning(false)
 {
 }
 
 Kid::Kid(const String& kid_name):
-    theName(kid_name),
-    badFailures(0),
-    pid(-1),
-    startTime(0),
-    isRunning(false)
+        theName(kid_name),
+        badFailures(0),
+        pid(-1),
+        startTime(0),
+        isRunning(false)
 {
 }
 
index 7ece20418dcdbd51702d686d7d066ee15d3f3ac5..7d0e370ac0ceb99eb97d4d1a545f7758d5283d50 100644 (file)
@@ -19,10 +19,12 @@ class TypedMsgHdr;
 
 /// message class identifier
 typedef enum { mtNone = 0, mtRegistration,
-    mtSharedListenRequest, mtSharedListenResponse } MessageType;
+               mtSharedListenRequest, mtSharedListenResponse
+             } MessageType;
 
 /// Strand location details
-class StrandCoord {
+class StrandCoord
+{
 public:
     StrandCoord(); ///< unknown location
     StrandCoord(int akidId, pid_t aPid); ///< from registrant
index b02c18ee4960e2daf17f1091fd5d9c843ff5e93d..328229e247afe0c7e2b1f426b8787a6e935776ed 100644 (file)
@@ -15,7 +15,7 @@ const char Ipc::strandAddrPfx[] = DEFAULT_PREFIX "/var/run/squid";
 
 
 Ipc::Port::Port(const String& aListenAddr):
-    UdsOp(aListenAddr)
+        UdsOp(aListenAddr)
 {
     setOptions(COMM_NONBLOCKING | COMM_DOBIND);
 }
@@ -31,7 +31,7 @@ void Ipc::Port::listen()
     debugs(54, 6, HERE);
     buf.prepForReading();
     AsyncCall::Pointer readHandler = asyncCall(54, 6, "Ipc::Port::noteRead",
-        CommCbMemFunT<Port, CommIoCbParams>(this, &Port::noteRead));
+                                     CommCbMemFunT<Port, CommIoCbParams>(this, &Port::noteRead));
     comm_read(fd(), buf.raw(), buf.size(), readHandler);
 }
 
@@ -53,7 +53,7 @@ String Ipc::Port::MakeAddr(const char* pathAddr, int id)
 void Ipc::Port::noteRead(const CommIoCbParams& params)
 {
     debugs(54, 6, HERE << "FD " << params.fd << " flag " << params.flag <<
-        " [" << this << ']');
+           " [" << this << ']');
     if (params.flag == COMM_OK) {
         assert(params.buf == buf.raw());
         receive(buf);
index 9e46fcb6e584136a267a60ba8dbe156a7c01382d..ada9cefac4eb1a4ac21fb671be82d9b87e953854 100644 (file)
@@ -80,12 +80,12 @@ void Ipc::SharedListenRequest::pack(TypedMsgHdr &hdrMsg) const
 
 
 Ipc::SharedListenResponse::SharedListenResponse(int aFd, int anErrNo, int aMapId):
-    fd(aFd), errNo(anErrNo), mapId(aMapId)
+        fd(aFd), errNo(anErrNo), mapId(aMapId)
 {
 }
 
 Ipc::SharedListenResponse::SharedListenResponse(const TypedMsgHdr &hdrMsg):
-    fd(-1), errNo(0), mapId(-1)
+        fd(-1), errNo(0), mapId(-1)
 {
     hdrMsg.getData(mtSharedListenResponse, this, sizeof(*this));
     fd = hdrMsg.getFd();
@@ -99,7 +99,7 @@ void Ipc::SharedListenResponse::pack(TypedMsgHdr &hdrMsg) const
 
 
 void Ipc::JoinSharedListen(const OpenListenerParams &params,
-    AsyncCall::Pointer &callback)
+                           AsyncCall::Pointer &callback)
 {
     PendingOpenRequest por;
     por.params = params;
@@ -111,7 +111,7 @@ void Ipc::JoinSharedListen(const OpenListenerParams &params,
     request.mapId = AddToMap(por);
 
     debugs(54, 3, HERE << "getting listening FD for " << request.params.addr <<
-        " mapId=" << request.mapId);
+           " mapId=" << request.mapId);
 
     TypedMsgHdr message;
     request.pack(message);
@@ -123,7 +123,7 @@ void Ipc::SharedListenJoined(const SharedListenResponse &response)
     const int fd = response.fd;
 
     debugs(54, 3, HERE << "got listening FD " << fd << " errNo=" <<
-        response.errNo << " mapId=" << response.mapId);
+           response.errNo << " mapId=" << response.mapId);
 
     Must(TheSharedListenRequestMap.find(response.mapId) != TheSharedListenRequestMap.end());
     PendingOpenRequest por = TheSharedListenRequestMap[response.mapId];
index 9292bd753df5ca52521f4d09079c267a8553090c..ff61538cc3f7774875762841116b57a8d5743c1d 100644 (file)
@@ -27,7 +27,7 @@ std::ostream &Ipc::StartListeningCb::startPrint(std::ostream &os) const
 
 
 void Ipc::StartListening(int sock_type, int proto, IpAddress &addr,
-    int flags, FdNoteId fdNote, AsyncCall::Pointer &callback)
+                         int flags, FdNoteId fdNote, AsyncCall::Pointer &callback)
 {
     OpenListenerParams p;
     p.sock_type = sock_type;
@@ -43,7 +43,7 @@ void Ipc::StartListening(int sock_type, int proto, IpAddress &addr,
 
     enter_suid();
     const int sock = comm_open_listener(p.sock_type, p.proto, p.addr, p.flags,
-        FdNote(p.fdNote));
+                                        FdNote(p.fdNote));
     const int errNo = (sock >= 0) ? 0 : errno;
     leave_suid();
 
index 9bf8e44f119ecd0db04e51452eb919442dba1a34..f2180d7543eb83923915341ffb56037323bb8b00 100644 (file)
@@ -35,7 +35,7 @@ public:
 /// Depending on whether SMP is on, either ask Coordinator to send us
 /// the listening FD or call comm_open_listener() directly.
 extern void StartListening(int sock_type, int proto, IpAddress &addr,
-    int flags, FdNoteId fdNote, AsyncCall::Pointer &callback);
+                           int flags, FdNoteId fdNote, AsyncCall::Pointer &callback);
 
 } // namespace Ipc;
 
index cc0bd841c26e391ac25b128c1567db80fff347a9..622f8c4e6bd8e02e545480101b94024c1c6ec948 100644 (file)
@@ -16,8 +16,8 @@ CBDATA_NAMESPACED_CLASS_INIT(Ipc, Strand);
 
 
 Ipc::Strand::Strand():
-    Port(MakeAddr(strandAddrPfx, KidIdentifier)),
-    isRegistered(false)
+        Port(MakeAddr(strandAddrPfx, KidIdentifier)),
+        isRegistered(false)
 {
 }
 
index b596b80c1d5e1c993a0c24c27ddaa7d3cf19a2f3..0b12ab48614f0075c89b85e360c80483a5a872ab 100644 (file)
 
 Ipc::TypedMsgHdr::TypedMsgHdr()
 {
-       xmemset(this, 0, sizeof(*this));
-       sync();
+    xmemset(this, 0, sizeof(*this));
+    sync();
 }
 
 Ipc::TypedMsgHdr::TypedMsgHdr(const TypedMsgHdr &tmh)
 {
-       xmemcpy(this, &tmh, sizeof(*this));
-       sync();
+    xmemcpy(this, &tmh, sizeof(*this));
+    sync();
 }
 
 Ipc::TypedMsgHdr &Ipc::TypedMsgHdr::operator =(const TypedMsgHdr &tmh)
 {
-       if (this != &tmh) { // skip assignment to self
-               xmemcpy(this, &tmh, sizeof(*this));
-               sync();
-       }
-       return *this;
+    if (this != &tmh) { // skip assignment to self
+        xmemcpy(this, &tmh, sizeof(*this));
+        sync();
+    }
+    return *this;
 }
 
 // update msghdr and ios pointers based on msghdr counters
 void Ipc::TypedMsgHdr::sync()
 {
-       if (msg_name) { // we have a name
-               msg_name = &name;
-       } else {
-               Must(!msg_namelen && !msg_name);
-       }
-
-       if (msg_iov) { // we have a data component
-               Must(msg_iovlen == 1);
-               msg_iov = ios;
-               ios[0].iov_base = &data;
-               Must(ios[0].iov_len == sizeof(data));
-       } else {
-               Must(!msg_iovlen && !msg_iov);
-       }
-
-       if (msg_control) { // we have a control component
-               Must(msg_controllen > 0);
-               msg_control = &ctrl;
-       } else {
-               Must(!msg_controllen && !msg_control);
-       }
+    if (msg_name) { // we have a name
+        msg_name = &name;
+    } else {
+        Must(!msg_namelen && !msg_name);
+    }
+
+    if (msg_iov) { // we have a data component
+        Must(msg_iovlen == 1);
+        msg_iov = ios;
+        ios[0].iov_base = &data;
+        Must(ios[0].iov_len == sizeof(data));
+    } else {
+        Must(!msg_iovlen && !msg_iov);
+    }
+
+    if (msg_control) { // we have a control component
+        Must(msg_controllen > 0);
+        msg_control = &ctrl;
+    } else {
+        Must(!msg_controllen && !msg_control);
+    }
 }
 
 
@@ -63,15 +63,15 @@ void Ipc::TypedMsgHdr::sync()
 int
 Ipc::TypedMsgHdr::type() const
 {
-       Must(msg_iovlen == 1);
-       return data.type_;
+    Must(msg_iovlen == 1);
+    return data.type_;
 }
 
 void
 Ipc::TypedMsgHdr::address(const struct sockaddr_un& addr)
 {
-       allocName();
-       name = addr;
+    allocName();
+    name = addr;
     msg_name = &name;
     msg_namelen = SUN_LEN(&name);
 }
@@ -79,81 +79,81 @@ Ipc::TypedMsgHdr::address(const struct sockaddr_un& addr)
 void
 Ipc::TypedMsgHdr::getData(int destType, void *raw, size_t size) const
 {
-       Must(type() == destType);
-       Must(size == data.size);
-       xmemcpy(raw, data.raw, size);
+    Must(type() == destType);
+    Must(size == data.size);
+    xmemcpy(raw, data.raw, size);
 }
 
 void
 Ipc::TypedMsgHdr::putData(int aType, const void *raw, size_t size)
 {
-       Must(size <= sizeof(data.raw));
-       allocData();
-       data.type_ = aType;
-       data.size = size;
-       xmemcpy(data.raw, raw, size);
+    Must(size <= sizeof(data.raw));
+    allocData();
+    data.type_ = aType;
+    data.size = size;
+    xmemcpy(data.raw, raw, size);
 }
 
 void
 Ipc::TypedMsgHdr::putFd(int fd)
 {
-       Must(fd >= 0);
-       allocControl();
+    Must(fd >= 0);
+    allocControl();
 
-       const int fdCount = 1;
+    const int fdCount = 1;
 
-       struct cmsghdr *cmsg = CMSG_FIRSTHDR(this);
-       cmsg->cmsg_level = SOL_SOCKET;
-       cmsg->cmsg_type = SCM_RIGHTS;
-       cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fdCount);
+    struct cmsghdr *cmsg = CMSG_FIRSTHDR(this);
+    cmsg->cmsg_level = SOL_SOCKET;
+    cmsg->cmsg_type = SCM_RIGHTS;
+    cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fdCount);
 
     int *fdStore = reinterpret_cast<int*>(CMSG_DATA(cmsg));
-       xmemcpy(fdStore, &fd, fdCount * sizeof(int));
+    xmemcpy(fdStore, &fd, fdCount * sizeof(int));
     msg_controllen = cmsg->cmsg_len;
 }
 
 int
 Ipc::TypedMsgHdr::getFd() const
 {
-       Must(msg_control && msg_controllen);
+    Must(msg_control && msg_controllen);
 
-       struct cmsghdr *cmsg = CMSG_FIRSTHDR(this);
-       Must(cmsg->cmsg_level == SOL_SOCKET);
-       Must(cmsg->cmsg_type == SCM_RIGHTS);
+    struct cmsghdr *cmsg = CMSG_FIRSTHDR(this);
+    Must(cmsg->cmsg_level == SOL_SOCKET);
+    Must(cmsg->cmsg_type == SCM_RIGHTS);
 
-       const int fdCount = 1;
+    const int fdCount = 1;
     const int *fdStore = reinterpret_cast<const int*>(CMSG_DATA(cmsg));
-       int fd = -1;
-       xmemcpy(&fd, fdStore, fdCount * sizeof(int));
-       return fd;
+    int fd = -1;
+    xmemcpy(&fd, fdStore, fdCount * sizeof(int));
+    return fd;
 }
 
 void
 Ipc::TypedMsgHdr::prepForReading()
 {
-       xmemset(this, 0, sizeof(*this));
-       allocName();
-       allocData();
-       allocControl();
+    xmemset(this, 0, sizeof(*this));
+    allocName();
+    allocData();
+    allocControl();
 }
 
 /// initialize io vector with one io record
 void
 Ipc::TypedMsgHdr::allocData()
 {
-       Must(!msg_iovlen && !msg_iov);
-       msg_iovlen = 1;
-       msg_iov = ios;
-       ios[0].iov_base = &data;
-       ios[0].iov_len = sizeof(data);
-       data.type_ = 0;
-       data.size = 0;
+    Must(!msg_iovlen && !msg_iov);
+    msg_iovlen = 1;
+    msg_iov = ios;
+    ios[0].iov_base = &data;
+    ios[0].iov_len = sizeof(data);
+    data.type_ = 0;
+    data.size = 0;
 }
 
 void
 Ipc::TypedMsgHdr::allocName()
 {
-       Must(!msg_name && !msg_namelen);
+    Must(!msg_name && !msg_namelen);
     msg_name = &name;
     msg_namelen = sizeof(name); // is that the right size?
 }
@@ -161,7 +161,7 @@ Ipc::TypedMsgHdr::allocName()
 void
 Ipc::TypedMsgHdr::allocControl()
 {
-       Must(!msg_control && !msg_controllen);
-       msg_control = &ctrl;
-       msg_controllen = sizeof(ctrl);
+    Must(!msg_control && !msg_controllen);
+    msg_control = &ctrl;
+    msg_controllen = sizeof(ctrl);
 }
index fafa048f5dff41db11069da3f3e84bb36e8ae914..513cd89127e31263ef1a75c23c0a4961f91029bb 100644 (file)
@@ -31,35 +31,35 @@ public:
     void address(const struct sockaddr_un& addr); ///< sets [dest.] address
     void getData(int ofType, void *raw, size_t size) const; ///< checks type
     void putData(int aType, const void *raw, size_t size); ///< stores type
-       void putFd(int aFd); ///< stores descriptor
-       int getFd() const; ///< returns descriptor
+    void putFd(int aFd); ///< stores descriptor
+    int getFd() const; ///< returns descriptor
 
     /// raw, type-independent access for I/O
-       void prepForReading(); ///< reset and provide all buffers
-       char *raw() { return reinterpret_cast<char*>(this); }
-       const char *raw() const { return reinterpret_cast<const char*>(this); }
+    void prepForReading(); ///< reset and provide all buffers
+    char *raw() { return reinterpret_cast<char*>(this); }
+    const char *raw() const { return reinterpret_cast<const char*>(this); }
     size_t size() const { return sizeof(*this); } ///< not true message size
 
 private:
-       void sync();
-       void allocData();
-       void allocName();
-       void allocControl();
+    void sync();
+    void allocData();
+    void allocName();
+    void allocControl();
 
 private:
-       struct sockaddr_un name; ///< same as .msg_name
+    struct sockaddr_un name; ///< same as .msg_name
 
-       struct iovec ios[1]; ///< same as .msg_iov[]
+    struct iovec ios[1]; ///< same as .msg_iov[]
 
-       struct DataBuffer {
-               int type_; ///< Message kind, uses MessageType values
-               size_t size; ///< actual raw data size (for sanity checks)
-               char raw[250]; ///< buffer with type-specific data
-       } data; ///< same as .msg_iov[0].iov_base
+    struct DataBuffer {
+        int type_; ///< Message kind, uses MessageType values
+        size_t size; ///< actual raw data size (for sanity checks)
+        char raw[250]; ///< buffer with type-specific data
+    } data; ///< same as .msg_iov[0].iov_base
 
-       struct CtrlBuffer {
-               char raw[CMSG_SPACE(sizeof(int))]; ///< control buffer space for one fd
-       } ctrl; ///< same as .msg_control
+    struct CtrlBuffer {
+        char raw[CMSG_SPACE(sizeof(int))]; ///< control buffer space for one fd
+    } ctrl; ///< same as .msg_control
 };
 
 } // namespace Ipc
index 9f6c005678fca684ddd8d2655f133843b22cda0d..741a33e0e4ae9c30d45ef9695279ba067aa81c76 100644 (file)
 
 
 Ipc::UdsOp::UdsOp(const String& pathAddr):
-    AsyncJob("Ipc::UdsOp"),
-    address(PathToAddress(pathAddr)),
-    options(COMM_NONBLOCKING),
-    fd_(-1)
+        AsyncJob("Ipc::UdsOp"),
+        address(PathToAddress(pathAddr)),
+        options(COMM_NONBLOCKING),
+        fd_(-1)
 {
     debugs(54, 5, HERE << '[' << this << "] pathAddr=" << pathAddr);
 }
@@ -47,8 +47,8 @@ int Ipc::UdsOp::fd()
 void Ipc::UdsOp::setTimeout(int seconds, const char *handlerName)
 {
     AsyncCall::Pointer handler = asyncCall(54,5, handlerName,
-        CommCbMemFunT<UdsOp, CommTimeoutCbParams>(this,
-            &UdsOp::noteTimeout));
+                                           CommCbMemFunT<UdsOp, CommTimeoutCbParams>(this,
+                                                   &UdsOp::noteTimeout));
     commSetTimeout(fd(), seconds, handler);
 }
 
@@ -64,8 +64,7 @@ void Ipc::UdsOp::noteTimeout(const CommTimeoutCbParams &)
 
 
 struct sockaddr_un
-Ipc::PathToAddress(const String& pathAddr)
-{
+Ipc::PathToAddress(const String& pathAddr) {
     assert(pathAddr.size() != 0);
     struct sockaddr_un unixAddr;
     memset(&unixAddr, 0, sizeof(unixAddr));
@@ -78,11 +77,11 @@ Ipc::PathToAddress(const String& pathAddr)
 CBDATA_NAMESPACED_CLASS_INIT(Ipc, UdsSender);
 
 Ipc::UdsSender::UdsSender(const String& pathAddr, const TypedMsgHdr& aMessage):
-    UdsOp(pathAddr),
-    message(aMessage),
-    retries(10), // TODO: make configurable?
-    timeout(10), // TODO: make configurable?
-    writing(false)
+        UdsOp(pathAddr),
+        message(aMessage),
+        retries(10), // TODO: make configurable?
+        timeout(10), // TODO: make configurable?
+        writing(false)
 {
     message.address(address);
 }
@@ -104,7 +103,7 @@ void Ipc::UdsSender::write()
 {
     debugs(54, 5, HERE);
     AsyncCall::Pointer writeHandler = asyncCall(54, 5, "Ipc::UdsSender::wrote",
-        CommCbMemFunT<UdsSender, CommIoCbParams>(this, &UdsSender::wrote));
+                                      CommCbMemFunT<UdsSender, CommIoCbParams>(this, &UdsSender::wrote));
     comm_write(fd(), message.raw(), message.size(), writeHandler);
     writing = true;
 }
index b1f3ea07af5ccbf423b6e5bd1d6db8dfed5f12e7..0187a4e3ee33404be3de9f373f7a9bb10135854c 100644 (file)
@@ -39,7 +39,7 @@ protected:
     void setTimeout(int seconds, const char *handlerName);
     void clearTimeout(); ///< remove previously set timeout, if any
 
-       void setOptions(int newOptions); ///< changes socket options
+    void setOptions(int newOptions); ///< changes socket options
 
 private:
     /// Comm timeout callback; calls timedout()
index 554d0610606b9f6c83c77e7c779b50b0f40fa509..362a5a6f46a425de3586e3856e08f4e67381774c 100644 (file)
@@ -624,37 +624,37 @@ serverConnectionsOpen(void)
     if (IamPrimaryProcess()) {
 #if USE_WCCP
 
-    wccpConnectionOpen();
+        wccpConnectionOpen();
 #endif
 
 #if USE_WCCPv2
 
-    wccp2ConnectionOpen();
+        wccp2ConnectionOpen();
 #endif
     }
     // Coordinator does not start proxying services
     if (!IamCoordinatorProcess()) {
-    clientOpenListenSockets();
-    icpConnectionsOpen();
+        clientOpenListenSockets();
+        icpConnectionsOpen();
 #if USE_HTCP
 
-    htcpInit();
+        htcpInit();
 #endif
 #ifdef SQUID_SNMP
 
-    snmpConnectionOpen();
+        snmpConnectionOpen();
 #endif
 
-    clientdbInit();
-    icmpEngine.Open();
-    netdbInit();
-    asnInit();
-    ACL::Initialize();
-    peerSelectInit();
-
-    carpInit();
-    peerUserHashInit();
-    peerSourceHashInit();
+        clientdbInit();
+        icmpEngine.Open();
+        netdbInit();
+        asnInit();
+        ACL::Initialize();
+        peerSelectInit();
+
+        carpInit();
+        peerUserHashInit();
+        peerSourceHashInit();
     }
 }
 
@@ -666,28 +666,28 @@ serverConnectionsClose(void)
     if (IamPrimaryProcess()) {
 #if USE_WCCP
 
-    wccpConnectionClose();
+        wccpConnectionClose();
 #endif
 #if USE_WCCPv2
 
-    wccp2ConnectionClose();
+        wccp2ConnectionClose();
 #endif
     }
     if (!IamCoordinatorProcess()) {
-    clientHttpConnectionsClose();
-    icpConnectionShutdown();
+        clientHttpConnectionsClose();
+        icpConnectionShutdown();
 #if USE_HTCP
 
-    htcpSocketShutdown();
+        htcpSocketShutdown();
 #endif
 
-    icmpEngine.Close();
+        icmpEngine.Close();
 #ifdef SQUID_SNMP
 
-    snmpConnectionShutdown();
+        snmpConnectionShutdown();
 #endif
 
-    asnFreeMemory();
+        asnFreeMemory();
     }
 }
 
@@ -752,8 +752,8 @@ mainReconfigureFinish(void *)
     }
     if (oldWorkers != Config.workers) {
         debugs(1, DBG_CRITICAL, "WARNING: Changing 'workers' (from " <<
-            oldWorkers << " to " << Config.workers <<
-            ") is not supported and ignored");
+               oldWorkers << " to " << Config.workers <<
+               ") is not supported and ignored");
         Config.workers = oldWorkers;
     }
 
@@ -788,11 +788,11 @@ mainReconfigureFinish(void *)
     if (IamPrimaryProcess()) {
 #if USE_WCCP
 
-    wccpInit();
+        wccpInit();
 #endif
 #if USE_WCCPv2
 
-    wccp2Init();
+        wccp2Init();
 #endif
     }
 
@@ -1051,12 +1051,12 @@ mainInitialize(void)
 
     if (IamPrimaryProcess()) {
 #if USE_WCCP
-    wccpInit();
+        wccpInit();
 
 #endif
 #if USE_WCCPv2
 
-    wccp2Init();
+        wccp2Init();
 
 #endif
     }
@@ -1189,7 +1189,7 @@ SquidMainSafe(int argc, char **argv)
 static void
 ConfigureCurrentKid(const char *processName)
 {
-       // kids are marked with parenthesis around their process names
+    // kids are marked with parenthesis around their process names
     if (processName && processName[0] == '(') {
         if (const char *idStart = strrchr(processName, '-')) {
             KidIdentifier = atoi(idStart + 1);
@@ -1640,9 +1640,9 @@ watch_child(char *argv[])
 
     if (Config.workers > 128) {
         syslog(LOG_ALERT, "Suspiciously high workers value: %d",
-            Config.workers);
+               Config.workers);
         // but we keep going in hope that user knows best
-       }
+    }
     TheKids.init(Config.workers);
 
     // keep [re]starting kids until it is time to quit
@@ -1683,19 +1683,18 @@ watch_child(char *argv[])
 
 #endif
         // Loop to collect all stopped kids before we go to sleep below.
-        do
-        {
+        do {
             Kid* kid = TheKids.find(pid);
             if (kid) {
                 kid->stop(status);
                 if (kid->calledExit()) {
                     syslog(LOG_NOTICE,
-                       "Squid Parent: child process %d exited with status %d",
-                        kid->getPid(), kid->exitStatus());
+                           "Squid Parent: child process %d exited with status %d",
+                           kid->getPid(), kid->exitStatus());
                 } else if (kid->signaled()) {
                     syslog(LOG_NOTICE,
-                       "Squid Parent: child process %d exited due to signal %d with status %d",
-                        kid->getPid(), kid->termSignal(), kid->exitStatus());
+                           "Squid Parent: child process %d exited due to signal %d with status %d",
+                           kid->getPid(), kid->termSignal(), kid->exitStatus());
                 } else {
                     syslog(LOG_NOTICE, "Squid Parent: child process %d exited", kid->getPid());
                 }
@@ -1705,7 +1704,8 @@ watch_child(char *argv[])
 #ifdef _SQUID_NEXT_
         } while ((pid = wait3(&status, WNOHANG, NULL)) > 0);
 #else
-        } while ((pid = waitpid(-1, &status, WNOHANG)) > 0);
+        }
+        while ((pid = waitpid(-1, &status, WNOHANG)) > 0);
 #endif
 
         if (TheKids.allExitedHappy()) {
index 37960375bc9a241011ce0d1dc0389ef6b79d2cdc..ce4ba9e9e174e081e3671ac19e6ec2133498769e 100644 (file)
@@ -578,7 +578,7 @@ SQUIDCEXTERN void keepCapabilities(void);
 SQUIDCEXTERN void BroadcastSignalIfAny(int& sig);
 /// whether the current process is the parent of all other Squid processes
 SQUIDCEXTERN bool IamMasterProcess();
-/** 
+/**
     whether the current process is dedicated to doing things that only
     a single process should do, such as PID file maintenance and WCCP
 */
index e67140d1486027b4420aa4d47d279f34192fce2b..287fbef1b5ecd147e4972a486bc5570685352a47 100644 (file)
@@ -42,7 +42,7 @@
 
 /// dials snmpConnectionOpened call
 class SnmpListeningStartedDialer: public CallDialer,
-    public Ipc::StartListeningCb
+        public Ipc::StartListeningCb
 {
 public:
     typedef void (*Handler)(int fd, int errNo);
@@ -307,27 +307,27 @@ snmpConnectionOpen(void)
         Config.Addrs.snmp_incoming.SetPort(Config.Port.snmp);
 
         AsyncCall::Pointer call = asyncCall(49, 2,
-            "snmpIncomingConnectionOpened",
-            SnmpListeningStartedDialer(&snmpIncomingConnectionOpened));
+                                            "snmpIncomingConnectionOpened",
+                                            SnmpListeningStartedDialer(&snmpIncomingConnectionOpened));
 
         Ipc::StartListening(SOCK_DGRAM,
-                              IPPROTO_UDP,
-                              Config.Addrs.snmp_incoming,
-                              COMM_NONBLOCKING,
-                              Ipc::fdnInSnmpSocket, call);
+                            IPPROTO_UDP,
+                            Config.Addrs.snmp_incoming,
+                            COMM_NONBLOCKING,
+                            Ipc::fdnInSnmpSocket, call);
 
         if (!Config.Addrs.snmp_outgoing.IsNoAddr()) {
             Config.Addrs.snmp_outgoing.SetPort(Config.Port.snmp);
 
             AsyncCall::Pointer call = asyncCall(49, 2,
-                "snmpOutgoingConnectionOpened",
-                SnmpListeningStartedDialer(&snmpOutgoingConnectionOpened));
-
-             Ipc::StartListening(SOCK_DGRAM,
-                                   IPPROTO_UDP,
-                                   Config.Addrs.snmp_outgoing,
-                                   COMM_NONBLOCKING,
-                                   Ipc::fdnOutSnmpSocket, call);
+                                                "snmpOutgoingConnectionOpened",
+                                                SnmpListeningStartedDialer(&snmpOutgoingConnectionOpened));
+
+            Ipc::StartListening(SOCK_DGRAM,
+                                IPPROTO_UDP,
+                                Config.Addrs.snmp_outgoing,
+                                COMM_NONBLOCKING,
+                                Ipc::fdnOutSnmpSocket, call);
         }
     }
 }
@@ -340,10 +340,10 @@ snmpIncomingConnectionOpened(int fd, int errNo)
         fatal("Cannot open Incoming SNMP Port");
 
     commSetSelect(theInSnmpConnection, COMM_SELECT_READ, snmpHandleUdp, NULL,
-        0);
+                  0);
 
     debugs(1, 1, "Accepting SNMP messages on " << Config.Addrs.snmp_incoming <<
-        ", FD " << theInSnmpConnection << ".");
+           ", FD " << theInSnmpConnection << ".");
 
     if (Config.Addrs.snmp_outgoing.IsNoAddr())
         theOutSnmpConnection = theInSnmpConnection;
@@ -357,10 +357,10 @@ snmpOutgoingConnectionOpened(int fd, int errNo)
         fatal("Cannot open Outgoing SNMP Port");
 
     commSetSelect(theOutSnmpConnection, COMM_SELECT_READ, snmpHandleUdp, NULL,
-        0);
+                  0);
 
     debugs(1, 1, "Outgoing SNMP messages on " << Config.Addrs.snmp_outgoing <<
-        ", FD " << theOutSnmpConnection << ".");
+           ", FD " << theOutSnmpConnection << ".");
 
     {
         struct addrinfo *xaddr = NULL;