]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Whitespace fixage.
authorBenno Rice <benno@squid-cache.org>
Fri, 29 Aug 2008 04:35:42 +0000 (14:35 +1000)
committerBenno Rice <benno@squid-cache.org>
Fri, 29 Aug 2008 04:35:42 +0000 (14:35 +1000)
src/url.cc

index 8cdf775cdf36547ba1d1fca6ab3f514fc321aacf..a066e06835cee4b15b6e3ae9b8138f766cf5b5a2 100644 (file)
@@ -535,62 +535,61 @@ urlCanonicalClean(const HttpRequest * request)
 const char *
 urlAbsolute(const HttpRequest * req, const char *relUrl)
 {
-    LOCAL_ARRAY(char, portbuf, 32);
-    LOCAL_ARRAY(char, urlbuf, MAX_URL);
+    char portbuf[32], urlbuf[MAX_URL];
     char *path, *last_slash;
 
     if (relUrl == NULL) {
-       return (NULL);
+        return (NULL);
     }
     if (req->method.id() == METHOD_CONNECT) {
-       return (NULL);
+        return (NULL);
     }
     if (strchr(relUrl, ':') != NULL) {
-       return (NULL);
+        return (NULL);
     }
     if (req->protocol == PROTO_URN) {
-       snprintf(urlbuf, MAX_URL, "urn:%s", req->urlpath.buf());
+        snprintf(urlbuf, MAX_URL, "urn:%s", req->urlpath.buf());
     } else {
-       portbuf[0] = '\0';
-       if (req->port != urlDefaultPort(req->protocol)) {
-           snprintf(portbuf, 32, ":%d", req->port);
-       }
-       if (relUrl[0] == '/') {
-           snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s",
-               ProtocolStr[req->protocol],
-               req->login,
-               *req->login ? "@" : null_string,
-               req->GetHost(),
-               portbuf,
-               relUrl
-               );
-       } else {
-           path = xstrdup(req->urlpath.buf());
-           last_slash = strrchr(path, '/');
-           if (last_slash == NULL) {
-               snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s/%s",
-                   ProtocolStr[req->protocol],
-                   req->login,
-                   *req->login ? "@" : null_string,
-                   req->GetHost(),
-                   portbuf,
-                   relUrl
-                   );
-           } else {
-               last_slash++;
-               *last_slash = '\0';
-               snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s%s",
-                   ProtocolStr[req->protocol],
-                   req->login,
-                   *req->login ? "@" : null_string,
-                   req->GetHost(),
-                   portbuf,
-                   path,
-                   relUrl
-                   );
-           }
-           xfree(path);
-       }
+       portbuf[0] = '\0';
+       if (req->port != urlDefaultPort(req->protocol)) {
+           snprintf(portbuf, 32, ":%d", req->port);
+       }
+       if (relUrl[0] == '/') {
+           snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s",
+                ProtocolStr[req->protocol],
+                req->login,
+                *req->login ? "@" : null_string,
+                req->GetHost(),
+                portbuf,
+                relUrl
+            );
+       } else {
+           path = xstrdup(req->urlpath.buf());
+           last_slash = strrchr(path, '/');
+           if (last_slash == NULL) {
+                snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s/%s",
+                    ProtocolStr[req->protocol],
+                    req->login,
+                    *req->login ? "@" : null_string,
+                    req->GetHost(),
+                    portbuf,
+                    relUrl
+                );
+           } else {
+                last_slash++;
+                *last_slash = '\0';
+                snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s%s",
+                    ProtocolStr[req->protocol],
+                    req->login,
+                    *req->login ? "@" : null_string,
+                    req->GetHost(),
+                    portbuf,
+                    path,
+                    relUrl
+                );
+           }
+           xfree(path);
+       }
     }
 
     return (xstrdup(urlbuf));