]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup parenthesis and formatting in some ZPH code.
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 11 Jun 2008 01:39:05 +0000 (13:39 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 11 Jun 2008 01:39:05 +0000 (13:39 +1200)
src/client_side_reply.cc

index 5b2bf4a6252a3156420075eec11009f55297b0e2..5a1cb7d61e4b0973f602263c3003e51ac6d94935 100644 (file)
@@ -1569,58 +1569,53 @@ clientReplyContext::doGetMoreData()
         /* guarantee nothing has been sent yet! */
         assert(http->out.size == 0);
         assert(http->out.offset == 0);
-#if USE_ZPH_QOS        
-        if (Config.zph_tos_local ||
-               Config.zph_tos_peer ||
-               Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask)
-               {
-                  int need_change = 0;
-                  int hit = 0;
-                  int tos = 0;
-                  int tos_old = 0;
-                  int tos_len = sizeof(tos_old);
-                  int res;
-                              
-                  if (Config.zph_tos_local)
-                  {
-                          /* local hit */
-                      hit = 1;
-                      tos = Config.zph_tos_local;
-                  }
-                  else if (Config.zph_tos_peer && 
-                               (http->request->hier.code==SIBLING_HIT ||
-                               Config.onoff.zph_tos_parent&&http->request->hier.code==PARENT_HIT))
-                  {
-                         /* sibling or parent hit */
-                      hit = 1;
-                      tos = Config.zph_tos_peer;
-                  }
-                  
-                  if (http->request->flags.proxy_keepalive)
-                  {
-                          res = getsockopt(http->getConn()->fd, IPPROTO_IP, IP_TOS, &tos_old, (socklen_t*)&tos_len);
-                      if (res < 0)
-                      {
-                          debugs(33, 1, "ZPH: error in getsockopt(IP_TOS) on keepalived FD "<< http->getConn()->fd << " " << xstrerror());
-                      }
-                      else if (hit && tos_old != tos)
-                      {
-                          /* HIT: 1-st request, or previous was MISS,
-                           * or local/parent hit change.
-                           */
-                          need_change = 1;                    
-                      }
-                  }
-                  else if (hit)
-                  {
-                          /* no keepalive */
-                      need_change = 1;
-                  }
-                  if (need_change) {
-                          comm_set_tos(http->getConn()->fd,tos);
-                  }
-               }        
-#endif /* USE_ZPH_QOS */        
+#if USE_ZPH_QOS
+        if(Config.zph_tos_local || Config.zph_tos_peer ||
+            (Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask) )
+        {
+            int need_change = 0;
+            int hit = 0;
+            int tos = 0;
+            int tos_old = 0;
+            int tos_len = sizeof(tos_old);
+            int res;
+
+            if (Config.zph_tos_local) {
+                /* local hit */
+                hit = 1;
+                tos = Config.zph_tos_local;
+            }
+            else if(Config.zph_tos_peer &&
+                    (http->request->hier.code==SIBLING_HIT ||
+                     (Config.onoff.zph_tos_parent && http->request->hier.code==PARENT_HIT ) ) )
+            {
+                /* sibling or parent hit */
+                hit = 1;
+                tos = Config.zph_tos_peer;
+             }
+
+             if(http->request->flags.proxy_keepalive) {
+                 res = getsockopt(http->getConn()->fd, IPPROTO_IP, IP_TOS, &tos_old, (socklen_t*)&tos_len);
+                 if (res < 0) {
+                     debugs(33, 1, "ZPH: error in getsockopt(IP_TOS) on keepalived FD "<< http->getConn()->fd << " " << xstrerror());
+                 }
+                 else if (hit && tos_old != tos) {
+                     /* HIT: 1-st request, or previous was MISS,
+                      * or local/parent hit change.
+                      */
+                     need_change = 1;                    
+                 }
+             }
+             else if (hit) {
+                 /* no keepalive */
+                 need_change = 1;
+             }
+             if(need_change) {
+                 comm_set_tos(http->getConn()->fd,tos);
+             }
+        }
+#endif /* USE_ZPH_QOS */
+
         tempBuffer.offset = reqofs;
         tempBuffer.length = getNextNode()->readBuffer.length;
         tempBuffer.data = getNextNode()->readBuffer.data;