]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
indent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl
authorwessels <>
Tue, 5 Dec 2000 16:15:57 +0000 (16:15 +0000)
committerwessels <>
Tue, 5 Dec 2000 16:15:57 +0000 (16:15 +0000)
15 files changed:
src/HttpMsg.cc
src/HttpReply.cc
src/HttpStatusLine.cc
src/cache_manager.cc
src/client_side.cc
src/errorpage.cc
src/gopher.cc
src/internal.cc
src/main.cc
src/mime.cc
src/protos.h
src/store_rebuild.cc
src/structs.h
src/tools.cc
src/urn.cc

index a9e50d18b9eb6fe6da1338a488029a31776ebdc1..aa9e166f3be32b238f41f3d13af6bc5c35513218 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpMsg.cc,v 1.8 2000/11/13 12:25:11 adrian Exp $
+ * $Id: HttpMsg.cc,v 1.9 2000/12/05 09:15:57 wessels Exp $
  *
  * DEBUG: section 74    HTTP Message
  * AUTHOR: Alex Rousskov
@@ -91,7 +91,7 @@ httpMsgIsolateHeaders(const char **parse_start, const char **blk_start, const ch
 int
 httpMsgIsPersistent(http_version_t http_ver, const HttpHeader * hdr)
 {
-    if ((http_ver.major>=1) && (http_ver.minor >= 1)) {
+    if ((http_ver.major >= 1) && (http_ver.minor >= 1)) {
        /*
         * for modern versions of HTTP: persistent unless there is
         * a "Connection: close" header.
index c91f31a747cc8aa2ff2a78999d03f6e05cd963a9..1ff2aa22aa66c79f3b3ec2c705797f6a8b7fad22 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.cc,v 1.43 2000/11/13 12:25:11 adrian Exp $
+ * $Id: HttpReply.cc,v 1.44 2000/12/05 09:15:57 wessels Exp $
  *
  * DEBUG: section 58    HTTP Reply (Response)
  * AUTHOR: Alex Rousskov
@@ -261,7 +261,7 @@ httpRedirectReply(HttpReply * reply, http_status status, const char *loc)
     HttpHeader *hdr;
     http_version_t ver;
     assert(reply);
-    httpBuildVersion(&ver,1,0);
+    httpBuildVersion(&ver, 1, 0);
     httpStatusLineSet(&reply->sline, ver, status, httpStatusString(status));
     hdr = &reply->header;
     httpHeaderPutStr(hdr, HDR_SERVER, full_appname_string);
index 3b9101a970ce64b488d86a7801b44b38d4c8e886..dcac362a8702b19fbfac372873026872d4fa7595 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpStatusLine.cc,v 1.20 2000/11/13 12:25:11 adrian Exp $
+ * $Id: HttpStatusLine.cc,v 1.21 2000/12/05 09:15:58 wessels Exp $
  *
  * DEBUG: section 57    HTTP Status-line
  * AUTHOR: Alex Rousskov
@@ -43,15 +43,15 @@ void
 httpStatusLineInit(HttpStatusLine * sline)
 {
     http_version_t version;
-    httpBuildVersion(&version,0,0);
-    httpStatusLineSet(sline, version , HTTP_STATUS_NONE, NULL);
+    httpBuildVersion(&version, 0, 0);
+    httpStatusLineSet(sline, version, HTTP_STATUS_NONE, NULL);
 }
 
 void
 httpStatusLineClean(HttpStatusLine * sline)
 {
     http_version_t version;
-    httpBuildVersion(&version,0,0);
+    httpBuildVersion(&version, 0, 0);
     httpStatusLineSet(sline, version, HTTP_INTERNAL_SERVER_ERROR, NULL);
 }
 
@@ -72,11 +72,11 @@ httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p)
 {
     assert(sline && p);
     debug(57, 9) ("packing sline %p using %p:\n", sline, p);
-    debug(57, 9) (HttpStatusLineFormat, sline->version.major, 
-        sline->version.minor, sline->status,
+    debug(57, 9) (HttpStatusLineFormat, sline->version.major,
+       sline->version.minor, sline->status,
        sline->reason ? sline->reason : httpStatusString(sline->status));
-    packerPrintf(p, HttpStatusLineFormat, sline->version.major, 
-         sline->version.minor, sline->status, httpStatusLineReason(sline));
+    packerPrintf(p, HttpStatusLineFormat, sline->version.major,
+       sline->version.minor, sline->status, httpStatusLineReason(sline));
 }
 
 /* pack fields using Packer */
@@ -90,8 +90,8 @@ httpStatusLineParse(HttpStatusLine * sline, const char *start, const char *end)
     start += 5;
     if (!xisdigit(*start))
        return 0;
-    if (sscanf(start, "%d.%d", &sline->version.major, &sline->version.minor)!=2){
-        debug(57, 7) ("httpStatusLineParse: Invalid HTTP identifier.\n");
+    if (sscanf(start, "%d.%d", &sline->version.major, &sline->version.minor) != 2) {
+       debug(57, 7) ("httpStatusLineParse: Invalid HTTP identifier.\n");
     }
     if (!(start = strchr(start, ' ')))
        return 0;
index 43caa145de91b732b105615bfae19dba5696e82b..6ef4962779fbbcf3892f980a930e294e024233c1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_manager.cc,v 1.23 2000/11/13 12:25:11 adrian Exp $
+ * $Id: cache_manager.cc,v 1.24 2000/12/05 09:15:58 wessels Exp $
  *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
@@ -253,11 +253,11 @@ cachemgrStart(int fd, request_t * request, StoreEntry * entry)
     if (a->flags.atomic)
        storeBuffer(entry);
     {
-        http_version_t version;
+       http_version_t version;
        HttpReply *rep = entry->mem_obj->reply;
        /* prove there are no previous reply headers around */
        assert(0 == rep->sline.status);
-        httpBuildVersion(&version,1,0);
+       httpBuildVersion(&version, 1, 0);
        httpReplySetHeaders(rep,
            version,
            HTTP_OK,
index fb7cffbe68ce3bd1ec57279c7155d680539f4df1..e510c741efeb99252f6d67b9a3df9471e2b51d90 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.513 2000/11/15 02:32:53 wessels Exp $
+ * $Id: client_side.cc,v 1.514 2000/12/05 09:15:58 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -603,7 +603,7 @@ clientPurgeRequest(clientHttpRequest * http)
      */
     http->entry = clientCreateStoreEntry(http, http->request->method, null_request_flags);
     httpReplyReset(r = http->entry->mem_obj->reply);
-    httpBuildVersion(&version,1,0);
+    httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(r, version, status, NULL, NULL, 0, 0, -1);
     httpReplySwapOut(r, http->entry);
     storeComplete(http->entry);
@@ -1279,7 +1279,7 @@ clientBuildReply(clientHttpRequest * http, const char *buf, size_t size)
     size_t k = headersEnd(buf, size);
     if (k && httpReplyParse(rep, buf, k)) {
        /* enforce 1.0 reply version */
-       httpBuildVersion(&rep->sline.version,1,0);
+       httpBuildVersion(&rep->sline.version, 1, 0);
        /* do header conversions */
        clientBuildReplyHeader(http, rep);
        /* if we do ranges, change status to "Partial Content" */
@@ -2094,7 +2094,7 @@ clientProcessRequest(clientHttpRequest * http)
            storeReleaseRequest(http->entry);
            storeBuffer(http->entry);
            rep = httpReplyCreate();
-            httpBuildVersion(&version,1,0);
+           httpBuildVersion(&version, 1, 0);
            httpReplySetHeaders(rep, version, HTTP_OK, NULL, "text/plain",
                httpRequestPrefixLen(r), 0, squid_curtime);
            httpReplySwapOut(rep, http->entry);
@@ -2308,16 +2308,16 @@ parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status,
     if (token == NULL) {
        debug(33, 3) ("parseHttpRequest: Missing HTTP identifier\n");
 #if RELAXED_HTTP_PARSER
-       httpBuildVersion(&http_ver,0,9);        /* wild guess */
+       httpBuildVersion(&http_ver, 0, 9);      /* wild guess */
 #else
        return parseHttpRequestAbort(conn, "error:missing-http-ident");
 #endif
     } else {
-        if (sscanf(token+5, "%d.%d", &http_ver.major, &http_ver.minor)!=2){
-            debug(33, 3) ("parseHttpRequest: Invalid HTTP identifier.\n");
-            return parseHttpRequestAbort(conn, "error: invalid HTTP-ident");
-        }
-        debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n",http_ver.major, http_ver.minor);
+       if (sscanf(token + 5, "%d.%d", &http_ver.major, &http_ver.minor) != 2) {
+           debug(33, 3) ("parseHttpRequest: Invalid HTTP identifier.\n");
+           return parseHttpRequestAbort(conn, "error: invalid HTTP-ident");
+       }
+       debug(33, 6) ("parseHttpRequest: Client HTTP version %d.%d.\n", http_ver.major, http_ver.minor);
     }
 
     /*
index f00564af9d8ad7607d1c3d802a4494dadd48d7b1..3b04c5ddfdd1b06cad7198fc360294b8a4ec4879 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.156 2000/11/13 12:25:11 adrian Exp $
+ * $Id: errorpage.cc,v 1.157 2000/12/05 09:15:59 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -576,7 +576,7 @@ errorBuildReply(ErrorState * err)
     MemBuf content = errorBuildContent(err);
     http_version_t version;
     /* no LMT for error pages; error pages expire immediately */
-    httpBuildVersion(&version,1,0);
+    httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(rep, version, err->http_status, NULL, "text/html", content.size, 0, squid_curtime);
     /*
      * include some information for downstream caches. Implicit
index d20b144bffa97476d0f54e101fb3090ff1024568..6ea450083e34a6098dbcac7a76e3732ba386d6eb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.156 2000/11/04 23:04:10 hno Exp $
+ * $Id: gopher.cc,v 1.157 2000/12/05 09:15:59 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -473,7 +473,7 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
                        if ((gtype == GOPHER_TELNET) || (gtype == GOPHER_3270)) {
                            if (strlen(escaped_selector) != 0)
                                snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG BORDER=0 SRC=\"%s\"> <A HREF=\"telnet://%s@%s%s%s/\">%s</A>\n",
-                                   icon_url, escaped_selector, rfc1738_escape_part(host), 
+                                   icon_url, escaped_selector, rfc1738_escape_part(host),
                                    *port ? ":" : "", port, html_quote(name));
                            else
                                snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG BORDER=0 SRC=\"%s\"> <A HREF=\"telnet://%s%s%s/\">%s</A>\n",
index a6e23f5d5f5b47336d2835b519defdfdb0d6bddc..3be4850360e034b1044bec722e74cbc524b52a28 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: internal.cc,v 1.21 2000/11/15 13:22:27 adrian Exp $
+ * $Id: internal.cc,v 1.22 2000/12/05 09:15:59 wessels Exp $
  *
  * DEBUG: section 76    Internal Squid Object handling
  * AUTHOR: Duane, Alex, Henrik
@@ -55,7 +55,7 @@ internalStart(request_t * request, StoreEntry * entry)
 #else
        const char *msgbuf = "This cache does not suport Cache Digests.\n";
 #endif
-        httpBuildVersion(&version,1,0);
+       httpBuildVersion(&version, 1, 0);
        httpReplySetHeaders(entry->mem_obj->reply,
            version,
            HTTP_NOT_FOUND,
@@ -105,8 +105,8 @@ internalRemoteUri(const char *host, u_short port, const char *dir, const char *n
      * domains
      */
     if (Config.appendDomain && !strchr(lc_host, '.'))
-        strncat(lc_host, Config.appendDomain, SQUIDHOSTNAMELEN - 
-        strlen(lc_host) - 1);
+       strncat(lc_host, Config.appendDomain, SQUIDHOSTNAMELEN -
+           strlen(lc_host) - 1);
     /* build uri in mb */
     memBufReset(&mb);
     memBufPrintf(&mb, "http://%s", lc_host);
index c2807ab2151755e7650c6f89d00ed6387fc0e4d0..3b8519450d98e4276fd0b08e42073bb9553d7f11 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.322 2000/11/10 09:04:51 adrian Exp $
+ * $Id: main.cc,v 1.323 2000/12/05 09:15:59 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -102,7 +102,7 @@ usage(void)
        "       -N        No daemon mode.\n"
        "       -R        Do not set REUSEADDR on port.\n"
        "       -S force  Force double-check swap during rebuild.\n"
-        "       -S reportonly Force double-check but do not attempt repair.\n"
+       "       -S reportonly Force double-check but do not attempt repair.\n"
        "       -V        Virtual host httpd-accelerator.\n"
        "       -X        Force full debugging.\n"
        "       -Y        Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload.\n",
@@ -134,14 +134,14 @@ mainParseOptions(int argc, char *argv[])
            opt_reuseaddr = 0;
            break;
        case 'S':
-            if ((int) strlen(optarg) < 1) 
-                usage();
-            else if (!strncmp(optarg, "force", strlen(optarg)))
-                opt_store_doublecheck = DBLCHECK_FORCE; /* trigger a doublecheck on startup */
-            else if (!strncmp(optarg, "reportonly", strlen(optarg)))
-                opt_store_doublecheck = DBLCHECK_REPORTONLY; /* trigger a doublecheck that doesn't repair */ 
-            else
-                usage();
+           if ((int) strlen(optarg) < 1)
+               usage();
+           else if (!strncmp(optarg, "force", strlen(optarg)))
+               opt_store_doublecheck = DBLCHECK_FORCE;         /* trigger a doublecheck on startup */
+           else if (!strncmp(optarg, "reportonly", strlen(optarg)))
+               opt_store_doublecheck = DBLCHECK_REPORTONLY;    /* trigger a doublecheck that doesn't repair */
+           else
+               usage();
            break;
        case 'V':
            vhost_mode = 1;
index 94ef8e8994bfa959ebfa3eecea2fada0c331666d..c6dd4f315b7c09e676307ababcf8e3350658f35a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.95 2000/11/13 12:25:12 adrian Exp $
+ * $Id: mime.cc,v 1.96 2000/12/05 09:15:59 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -422,7 +422,7 @@ mimeLoadIconFile(const char *icon)
     storeBuffer(e);
     e->mem_obj->request = requestLink(urlParse(METHOD_GET, url));
     httpReplyReset(reply = e->mem_obj->reply);
-    httpBuildVersion(&version,1,0);
+    httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(reply, version, HTTP_OK, NULL,
        type, (int) sb.st_size, sb.st_mtime, -1);
     reply->cache_control = httpHdrCcCreate();
index 35e939a15f025047a676537ffd47378282b6988b..5a03757900918ad34ad0930876f82995ab5d81f0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.387 2000/11/13 12:25:12 adrian Exp $
+ * $Id: protos.h,v 1.388 2000/12/05 09:15:59 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -284,7 +284,7 @@ extern void httpAnonInitModule(void);
 extern int httpAnonHdrAllowed(http_hdr_type hdr_id);
 extern int httpAnonHdrDenied(http_hdr_type hdr_id);
 extern void httpBuildRequestHeader(request_t *, request_t *, StoreEntry *, HttpHeader *, int, http_state_flags);
-extern void httpBuildVersion(http_version_t *version,unsigned int major,unsigned int minor);
+extern void httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor);
 
 /* ETag */
 extern int etagParseInit(ETag * etag, const char *str);
index dda96d1e71aed4c1d83f26550a5ccbadc6de1b71..37f7f9666f24009ed98a5b713d750bf0138d8d67 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_rebuild.cc,v 1.72 2000/11/10 09:04:51 adrian Exp $
+ * $Id: store_rebuild.cc,v 1.73 2000/12/05 09:16:00 wessels Exp $
  *
  * DEBUG: section 20    Store Rebuild Routines
  * AUTHOR: Duane Wessels
@@ -74,7 +74,7 @@ storeCleanup(void *datanotused)
            store_dirs_rebuilding--;
            assert(0 == store_dirs_rebuilding);
            if (opt_store_doublecheck != DBLCHECK_NONE)
-            /* we want to assert here because the storeFScode should auto-clean the entries */
+               /* we want to assert here because the storeFScode should auto-clean the entries */
                assert(store_errors == 0);
            if (store_digest)
                storeDigestNoteStoreReady();
@@ -93,10 +93,10 @@ storeCleanup(void *datanotused)
            if (e->swap_filen < 0)
                continue;
            if (opt_store_doublecheck != DBLCHECK_NONE)
-               if (storeCleanupDoubleCheck(e)){
-                    /* this should never happen as the storeFScode should auto-clean */
+               if (storeCleanupDoubleCheck(e)) {
+                   /* this should never happen as the storeFScode should auto-clean */
                    store_errors++;
-                }    
+               }
            EBIT_SET(e->flags, ENTRY_VALIDATED);
            /*
             * Only set the file bit if we know its a valid entry
@@ -146,8 +146,8 @@ storeRebuildComplete(struct _store_rebuild_data *dc)
     debug(20, 1) ("  %7d Swapfile clashes avoided.\n", counts.clashcount);
     debug(20, 1) ("  %7d Missing files ignored.\n", counts.missingcount);
     debug(20, 1) ("  %7d Incorrect length swapfiles %s.\n",
-      counts.filesizemismatchcount,
-      (opt_store_doublecheck == DBLCHECK_REPORTONLY) ? "ignored" : "unlinked");
+       counts.filesizemismatchcount,
+       (opt_store_doublecheck == DBLCHECK_REPORTONLY) ? "ignored" : "unlinked");
     debug(20, 1) ("  Took %3.1f seconds (%6.1f objects/sec).\n", dt,
        (double) counts.objcount / (dt > 0.0 ? dt : 1.0));
     debug(20, 1) ("Beginning Validation Procedure\n");
index de87fce53af419566192b25b54e38dd46ea693be..48285050d0e47cab92d580d887667317f3166341 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.362 2000/12/05 06:24:00 wessels Exp $
+ * $Id: structs.h,v 1.363 2000/12/05 09:16:00 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -846,7 +846,7 @@ struct _AccessLogEntry {
        method_t method;
        int code;
        const char *content_type;
-        http_version_t version;
+       http_version_t version;
     } http;
     struct {
        icp_opcode opcode;
@@ -1850,7 +1850,7 @@ struct _store_rebuild_data {
     int invalid;               /* # bad lines */
     int badflags;              /* # bad e->flags */
     int missingcount;          /* # swapfiles not on disk */
-    int filesizemismatchcount;  /* # swapfiles with a wrong size */
+    int filesizemismatchcount; /* # swapfiles with a wrong size */
     int bad_log_op;
     int zero_object_sz;
 };
index 9675efd5f7acb560ec8d4944c782d44deb679e4f..7a916a7724ec77d24859281ae9618caf270374a5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.198 2000/11/15 12:53:50 adrian Exp $
+ * $Id: tools.cc,v 1.199 2000/12/05 09:16:01 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -449,11 +449,11 @@ getMyHostname(void)
                inet_ntoa(Config.Sockaddr.http->s.sin_addr),
                host);
            present = 1;
-            if( strchr( host, '.' ) )
-                return host;
+           if (strchr(host, '.'))
+               return host;
 
        }
-        debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n",
+       debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n",
            inet_ntoa(Config.Sockaddr.http->s.sin_addr));
     }
     /*
@@ -470,8 +470,8 @@ getMyHostname(void)
        /* use the official name from DNS lookup */
        xstrncpy(host, h->h_name, SQUIDHOSTNAMELEN);
        present = 1;
-        if( strchr( host, '.' ) )
-            return host;
+       if (strchr(host, '.'))
+           return host;
     }
     fatal("Could not determine fully qualified hostname.  Please set 'visible_hostname'\n");
     return NULL;               /* keep compiler happy */
index 2be95d0cf98e5a1bc9652824c6aa0b820c64e067..5168fbc80e913a2f691b463bbb5d55a7fc258d98 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: urn.cc,v 1.61 2000/11/13 12:25:13 adrian Exp $
+ * $Id: urn.cc,v 1.62 2000/12/05 09:16:02 wessels Exp $
  *
  * DEBUG: section 52    URN Parsing
  * AUTHOR: Kostas Anagnostakis
@@ -273,7 +273,7 @@ urnHandleReply(void *data, char *buf, ssize_t size)
        full_appname_string, getMyHostname());
     rep = e->mem_obj->reply;
     httpReplyReset(rep);
-    httpBuildVersion(&version,1,0);
+    httpBuildVersion(&version, 1, 0);
     httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL,
        "text/html", mb.size, 0, squid_curtime);
     if (urnState->flags.force_menu) {