]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Fri, 17 Oct 1997 06:00:27 +0000 (06:00 +0000)
committerwessels <>
Fri, 17 Oct 1997 06:00:27 +0000 (06:00 +0000)
25 files changed:
src/acl.cc
src/cache_cf.cc
src/cachemgr.cc
src/client.cc
src/client_side.cc
src/disk.cc
src/dns.cc
src/dnsserver.cc
src/errorpage.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/icmp.cc
src/ident.cc
src/ipcache.cc
src/mime.cc
src/redirect.cc
src/send-announce.cc
src/stat.cc
src/store.cc
src/store_dir.cc
src/tools.cc
src/url.cc
src/useragent.cc
src/wais.cc

index 74612d7959b7f76b6f365a23c44d0d8c268bbd42..0e6bc43a0f2cb305c5bd82e5ef87ea117d5d91e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: acl.cc,v 1.108 1997/08/26 17:30:34 wessels Exp $
+ * $Id: acl.cc,v 1.109 1997/10/17 00:00:27 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -1652,7 +1652,7 @@ aclReadProxyAuth(struct _acl_proxy_auth *p)
                    p->hash = hash_create(urlcmp, 7921, hash_string);
                    if (p->hash == NULL) {
                        debug(28, 0) ("aclReadProxyAuth: can't create "
-                               "hash table, turning auth off.\n");
+                           "hash table, turning auth off.\n");
                        return 0;
                    }
                }
index d3690fa505cc5d1eda3d31b9280ded2180347cb3..5729ff10043f6d57bd1336450f59e2bce8ac163e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.224 1997/10/13 22:09:03 kostas Exp $
+ * $Id: cache_cf.cc,v 1.225 1997/10/17 00:00:29 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -70,7 +70,7 @@ static void free_all _PARAMS((void));
 static void
 self_destruct(void)
 {
-    snprintf(fatal_str,BUFSIZ, "Bungled %s line %d: %s",
+    snprintf(fatal_str, BUFSIZ, "Bungled %s line %d: %s",
        cfg_filename, config_lineno, config_input_line);
     fatal(fatal_str);
 }
index f112b6b5a8f19c471f1afa89cca52b3851afed61..0a286d0dfa5c6cb98cb71994684e02abab76e56d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cachemgr.cc,v 1.61 1997/10/13 22:09:04 kostas Exp $
+ * $Id: cachemgr.cc,v 1.62 1997/10/17 00:00:30 wessels Exp $
  *
  * DEBUG: section 0     CGI Cache Manager
  * AUTHOR: Harvest Derived
@@ -520,7 +520,7 @@ describeTimeSince(time_t then)
        snprintf(buf, 128, "%dM", (int) (delta / ONE_MONTH));
     else
        snprintf(buf, 128, "%dY", (int) (delta / ONE_YEAR));
-    snprintf(buf2,128, fmt, buf);
+    snprintf(buf2, 128, fmt, buf);
     return buf2;
 }
 
@@ -657,12 +657,12 @@ main(int argc, char *argv[])
        /* convert hostname:portnum to host=hostname&port=portnum */
        if (*s && !strchr(s, '=') && !strchr(s, '&')) {
            char *p;
-            int len_buff=strlen(s) + sizeof "host=&port=";
+           int len_buff = strlen(s) + sizeof "host=&port=";
            buffer = xmalloc(len_buff);
            if ((p = strchr(s, ':')))
                if (p != s) {
                    *p = '\0';
-                   snprintf(buffer, len_buff,"host=%s&port=%s", s, p + 1);
+                   snprintf(buffer, len_buff, "host=%s&port=%s", s, p + 1);
                } else {
                    snprintf(buffer, len_buff, "port=%s", p + 1);
            } else
index 9dd057300293c5f07c57328306ccd65cb71a10db..ecab1ba0501772360908f39f51765e0e5bbea721 100644 (file)
@@ -1,7 +1,8 @@
 
 
+
 /*
- * $Id: client.cc,v 1.30 1997/10/13 22:09:05 kostas Exp $
+ * $Id: client.cc,v 1.31 1997/10/17 00:00:31 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index c1b4a5cfb11cffd5263af7597a9049b398888a88..0653a035389bbbf40adb47ff9cf3fb81ccca7c1b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.126 1997/10/13 22:09:05 kostas Exp $
+ * $Id: client_side.cc,v 1.127 1997/10/17 00:00:32 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -333,7 +333,7 @@ clientConstructTraceEcho(clientHttpRequest * http)
     size_t len;
     memset(buf, '\0', 8192);
     snprintf(buf, 8192, "HTTP/1.0 200 OK\r\n");
-    snprintf(line, 256,  "Date: %s\r\n", mkrfc1123(squid_curtime));
+    snprintf(line, 256, "Date: %s\r\n", mkrfc1123(squid_curtime));
     strcat(buf, line);
     snprintf(line, 256, "Server: Squid/%s\r\n", SQUID_VERSION);
     strcat(buf, line);
index 23e955f079ca2d4b15225d6fad82320436ba4a49..f8f3264e7d17a1918374784b9432199a530eb7b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: disk.cc,v 1.78 1997/10/16 23:59:53 wessels Exp $
+ * $Id: disk.cc,v 1.79 1997/10/17 00:00:33 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -316,15 +316,15 @@ diskHandleWriteComplete(void *data, int len, int errcode)
     }
     if (q != NULL) {
        /* q might become NULL from write failure above */
-       q->cur_offset += len;
-       assert(q->cur_offset <= q->len);
-       if (q->cur_offset == q->len) {
-               /* complete write */
-               fdd->write_q = q->next;
-               if (q->free)
-               (q->free) (q->buf);
-               safe_free(q);
-       }
+       q->cur_offset += len;
+       assert(q->cur_offset <= q->len);
+       if (q->cur_offset == q->len) {
+           /* complete write */
+           fdd->write_q = q->next;
+           if (q->free)
+               (q->free) (q->buf);
+           safe_free(q);
+       }
     }
     if (fdd->write_q == NULL) {
        /* no more data */
index f40452f96dddf49e87137e128af87b9cca210e1b..1909c47a73ea9155097263c8a44cb98144f80c21 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns.cc,v 1.41 1997/10/13 22:09:06 kostas Exp $
+ * $Id: dns.cc,v 1.42 1997/10/17 00:00:33 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -276,7 +276,7 @@ dnsOpenServers(void)
                s++;
            else
                s = prg;
-           snprintf(fd_note_buf,FD_DESC_SZ, "%s #%d", s, dns_child_table[k]->id);
+           snprintf(fd_note_buf, FD_DESC_SZ, "%s #%d", s, dns_child_table[k]->id);
            fd_note(dns_child_table[k]->inpipe, fd_note_buf);
            commSetNonBlocking(dns_child_table[k]->inpipe);
            debug(34, 3) ("dnsOpenServers: 'dns_server' %d started\n", k);
index 06e4dbfd1550a9437a16a0805accd1b40e6ec4ab..fafc7466aa4e68c74f1d704a4dfe02ef11c91bf2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dnsserver.cc,v 1.36 1997/10/16 23:59:53 wessels Exp $
+ * $Id: dnsserver.cc,v 1.37 1997/10/17 00:00:34 wessels Exp $
  *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
@@ -365,7 +365,7 @@ main(int argc, char *argv[])
        msg[0] = '\0';
        if (!result) {
            if (h_errno == TRY_AGAIN) {
-               snprintf(msg, 1024,  "Name Server for domain '%s' is unavailable.\n",
+               snprintf(msg, 1024, "Name Server for domain '%s' is unavailable.\n",
                    request);
            } else {
                snprintf(msg, 1024, "DNS Domain '%s' is invalid: %s.\n",
index 9d2f85e75c6663c64696f262e2f5ac63cb0dd1f7..2fa0660ce73b475b5d64f51951c826a45017a050 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.74 1997/10/16 23:59:54 wessels Exp $
+ * $Id: errorpage.cc,v 1.75 1997/10/17 00:00:35 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -129,30 +129,30 @@ errorConvert(char token, ErrorState * err)
        break;
     case 'e':
        snprintf(buf, CVT_BUF_SZ, "%d", err->errno);
-       p=buf;
+       p = buf;
        break;
     case 'E':
        snprintf(buf, CVT_BUF_SZ, "(%d) %s", err->errno, strerror(err->errno));
        break;
     case 'w':
-       snprintf(buf, CVT_BUF_SZ, "%s",Config.adminEmail);
+       snprintf(buf, CVT_BUF_SZ, "%s", Config.adminEmail);
        break;
     case 'h':
        snprintf(buf, CVT_BUF_SZ, "%s", getMyHostname());
        break;
 /*
- * e - errno                                   x
- * E - strerror()                              x
+ * e - errno                                  x
+ * E - strerror()                               x
  * t - local time
  * T - UTC
  * c - Squid error code
  * I - server IP address
  * i - client IP address
  * L - HREF link for more info/contact
- * w - cachemgr email address                  x
- * h - cache hostname                          x
+ * w - cachemgr email address                   x
+ * h - cache hostname                           x
  * d - seconds elapsed since request received
- * p - URL port #                              x
+ * p - URL port #                               x
  */
     default:
        p = "%UNKNOWN%";
index 69457b2dfb6ef5e34c27ba42c90099614800a791..888fdebc2990c454457d874b5555cde20f7bbd05 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.138 1997/10/16 23:59:55 wessels Exp $
+ * $Id: ftp.cc,v 1.139 1997/10/17 00:00:36 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -476,7 +476,7 @@ ftpHtmlifyListEntry(char *line, int flags)
            "http://internal.squid/icons/",
            ICON_DIRUP,
            "[DIR]");
-       snprintf(link, 2048,  "<A HREF=\"%s\">%s</A>", "../", "Parent Directory");
+       snprintf(link, 2048, "<A HREF=\"%s\">%s</A>", "../", "Parent Directory");
        snprintf(html, 8192, "%s %s\n", icon, link);
        return html;
     }
@@ -509,7 +509,7 @@ ftpHtmlifyListEntry(char *line, int flags)
            "http://internal.squid/icons/",
            ICON_MENU,
            "[DIR]");
-       snprintf(link, 2048,  "<A HREF=\"%s/\">%s</A>%s",
+       snprintf(link, 2048, "<A HREF=\"%s/\">%s</A>%s",
            ename,
            parts->showname,
            dots_fill(strlen(parts->showname)));
@@ -519,7 +519,7 @@ ftpHtmlifyListEntry(char *line, int flags)
            parts->date);
        break;
     case 'l':
-       snprintf(icon, 2048,  "<IMG SRC=\"%s%s\" ALT=\"%-6s\">",
+       snprintf(icon, 2048, "<IMG SRC=\"%s%s\" ALT=\"%-6s\">",
            "http://internal.squid/icons/",
            ICON_LINK,
            "[LINK]");
@@ -534,7 +534,7 @@ ftpHtmlifyListEntry(char *line, int flags)
        break;
     case '-':
     default:
-       snprintf(icon, 2048,  "<IMG SRC=\"%s%s\" ALT=\"%-6s\">",
+       snprintf(icon, 2048, "<IMG SRC=\"%s%s\" ALT=\"%-6s\">",
            "http://internal.squid/icons/",
            mimeGetIcon(parts->name),
            "[FILE]");
@@ -828,7 +828,7 @@ ftpBuildTitleUrl(FtpStateData * ftpState)
     }
     strcat(t, request->host);
     if (request->port != urlDefaultPort(PROTO_FTP))
-       snprintf(&t[strlen(t)], len-strlen(t), ":%d", request->port);
+       snprintf(&t[strlen(t)], len - strlen(t), ":%d", request->port);
     strcat(t, "/");
     if (!EBIT_TEST(ftpState->flags, FTP_ROOT_DIR))
        strcat(t, request->urlpath);
@@ -856,9 +856,9 @@ ftpStart(request_t * request, StoreEntry * entry)
     if (!ftpCheckAuth(ftpState, request->headers)) {
        /* This request is not fully authenticated */
        if (request->port == 21) {
-           snprintf(realm,8192, "ftp %s", ftpState->user);
+           snprintf(realm, 8192, "ftp %s", ftpState->user);
        } else {
-           snprintf(realm,8192, "ftp %s port %d",
+           snprintf(realm, 8192, "ftp %s port %d",
                ftpState->user, request->port);
        }
        response = ftpAuthRequired(request, realm);
@@ -1118,11 +1118,11 @@ ftpReadWelcome(FtpStateData * ftpState)
            if (strstr(ftpState->ctrl.message->key, "NetWare"))
                EBIT_SET(ftpState->flags, FTP_SKIP_WHITESPACE);
        if (ftpState->proxy_host != NULL)
-           snprintf(cbuf,1024, "USER %s@%s\r\n",
+           snprintf(cbuf, 1024, "USER %s@%s\r\n",
                ftpState->user,
                ftpState->request->host);
        else
-           snprintf(cbuf,1024, "USER %s\r\n", ftpState->user);
+           snprintf(cbuf, 1024, "USER %s\r\n", ftpState->user);
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_USER;
     } else {
@@ -1138,7 +1138,7 @@ ftpReadUser(FtpStateData * ftpState)
     if (code == 230) {
        ftpReadPass(ftpState);
     } else if (code == 331) {
-       snprintf(cbuf,1024, "PASS %s\r\n", ftpState->password);
+       snprintf(cbuf, 1024, "PASS %s\r\n", ftpState->password);
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_PASS;
     } else {
@@ -1158,7 +1158,7 @@ ftpReadPass(FtpStateData * ftpState)
        t = strrchr(ftpState->request->urlpath, '/');
        filename = t ? t + 1 : ftpState->request->urlpath;
        mode = mimeGetTransferMode(filename);
-       snprintf(cbuf,1024, "TYPE %c\r\n", mode);
+       snprintf(cbuf, 1024, "TYPE %c\r\n", mode);
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_TYPE;
     } else {
@@ -1342,7 +1342,7 @@ ftpReadPasv(FtpStateData * ftpState)
        ftpSendPort(ftpState);
        return;
     }
-    snprintf(junk,1024, "%d.%d.%d.%d", h1, h2, h3, h4);
+    snprintf(junk, 1024, "%d.%d.%d.%d", h1, h2, h3, h4);
     if (!safe_inet_addr(junk, NULL)) {
        debug(9, 1) ("unsafe address (%s)\n", junk);
        ftpSendPort(ftpState);
@@ -1400,12 +1400,12 @@ ftpRestOrList(FtpStateData * ftpState)
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_LIST;
     } else if (ftpState->restart_offset > 0) {
-       snprintf(cbuf,1024, "REST\r\n");
+       snprintf(cbuf, 1024, "REST\r\n");
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_REST;
     } else {
        assert(ftpState->filepath != NULL);
-       snprintf(cbuf,1024, "RETR %s\r\n", ftpState->filepath);
+       snprintf(cbuf, 1024, "RETR %s\r\n", ftpState->filepath);
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_RETR;
     }
@@ -1419,7 +1419,7 @@ ftpReadRest(FtpStateData * ftpState)
     assert(ftpState->restart_offset > 0);
     if (code == 350) {
        assert(ftpState->filepath != NULL);
-       snprintf(cbuf,1024, "RETR %s\r\n", ftpState->filepath);
+       snprintf(cbuf, 1024, "RETR %s\r\n", ftpState->filepath);
        ftpWriteCommand(cbuf, ftpState);
        ftpState->state = SENT_RETR;
     } else if (code > 0) {
@@ -1495,7 +1495,7 @@ ftpDataTransferDone(FtpStateData * ftpState)
        ftpState->data.fd = -1;
     }
     assert(ftpState->ctrl.fd > -1);
-    snprintf(cbuf,1024, "QUIT\r\n");
+    snprintf(cbuf, 1024, "QUIT\r\n");
     ftpWriteCommand(cbuf, ftpState);
     ftpState->state = SENT_QUIT;
 }
index 2f1f53ab60c62634c2dd29157994119cdcb07e42..886e9123882a280f332ee869871893af6c1c878e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.96 1997/10/16 23:59:56 wessels Exp $
+ * $Id: gopher.cc,v 1.97 1997/10/17 00:00:37 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -207,8 +207,8 @@ gopher_mime_content(char *buf, const char *name, const char *def_ctype)
     char *ctype = mimeGetContentType(name);
     char *cenc = mimeGetContentEncoding(name);
     if (cenc)
-       snprintf(buf + strlen(buf), MAX_MIME-strlen(buf), "Content-Encoding: %s\r\n", cenc);
-    snprintf(buf + strlen(buf), MAX_MIME-strlen(buf), "Content-Type: %s\r\n",
+       snprintf(buf + strlen(buf), MAX_MIME - strlen(buf), "Content-Encoding: %s\r\n", cenc);
+    snprintf(buf + strlen(buf), MAX_MIME - strlen(buf), "Content-Type: %s\r\n",
        ctype ? ctype : def_ctype);
 }
 
@@ -332,7 +332,7 @@ gopherEndHTML(GopherStateData * gopherState)
 
     if (!gopherState->data_in) {
        snprintf(tmpbuf, TEMP_BUF_SIZE,
-               "<HTML><HEAD><TITLE>Server Return Nothing.</TITLE>\n"
+           "<HTML><HEAD><TITLE>Server Return Nothing.</TITLE>\n"
            "</HEAD><BODY><HR><H1>Server Return Nothing.</H1></BODY></HTML>\n");
        storeAppend(gopherState->entry, tmpbuf, strlen(tmpbuf));
        return;
@@ -367,8 +367,8 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
     entry = gopherState->entry;
 
     if (gopherState->conversion == HTML_INDEX_PAGE) {
-       snprintf(outbuf, TEMP_BUF_SIZE << 4, 
-            "<HTML><HEAD><TITLE>Gopher Index %s</TITLE></HEAD>\n"
+       snprintf(outbuf, TEMP_BUF_SIZE << 4,
+           "<HTML><HEAD><TITLE>Gopher Index %s</TITLE></HEAD>\n"
            "<BODY><H1>%s<BR>Gopher Search</H1>\n"
            "<p>This is a searchable Gopher index. Use the search\n"
            "function of your browser to enter search terms.\n"
@@ -381,8 +381,8 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
        return;
     }
     if (gopherState->conversion == HTML_CSO_PAGE) {
-       snprintf(outbuf, TEMP_BUF_SIZE << 4, 
-            "<HTML><HEAD><TITLE>CSO Search of %s</TITLE></HEAD>\n"
+       snprintf(outbuf, TEMP_BUF_SIZE << 4,
+           "<HTML><HEAD><TITLE>CSO Search of %s</TITLE></HEAD>\n"
            "<BODY><H1>%s<BR>CSO Search</H1>\n"
            "<P>A CSO database usually contains a phonebook or\n"
            "directory.  Use the search function of your browser to enter\n"
@@ -555,7 +555,7 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
                                    icon_type, host, name);
 
                        } else {
-                           snprintf(tmpbuf, TEMP_BUF_SIZE,  "<IMG BORDER=0 SRC=\"%s\"> <A HREF=\"gopher://%s/%c%s\">%s</A>\n",
+                           snprintf(tmpbuf, TEMP_BUF_SIZE, "<IMG BORDER=0 SRC=\"%s\"> <A HREF=\"gopher://%s/%c%s\">%s</A>\n",
                                icon_type, host, gtype, escaped_selector, name);
                        }
                        safe_free(escaped_selector);
@@ -590,10 +590,10 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len)
                        break;
 
                    if (gopherState->cso_recno != recno) {
-                       snprintf(tmpbuf,TEMP_BUF_SIZE, "</PRE><HR><H2>Record# %d<br><i>%s</i></H2>\n<PRE>", recno, result);
+                       snprintf(tmpbuf, TEMP_BUF_SIZE, "</PRE><HR><H2>Record# %d<br><i>%s</i></H2>\n<PRE>", recno, result);
                        gopherState->cso_recno = recno;
                    } else {
-                       snprintf(tmpbuf,TEMP_BUF_SIZE, "%s\n", result);
+                       snprintf(tmpbuf, TEMP_BUF_SIZE, "%s\n", result);
                    }
                    strcat(outbuf, tmpbuf);
                    gopherState->data_in = 1;
@@ -652,12 +652,12 @@ gopherTimeout(int fd, void *data)
     ErrorState *err;
 
     debug(10, 4) ("gopherTimeout: FD %d: '%s'\n", fd, entry->url);
-       /* was assert */
-    if (entry->object_len == 0)  {
-       err=xcalloc(1,sizeof(ErrorState));
-       err->type=ERR_READ_TIMEOUT;
-       err->http_status=HTTP_GATEWAY_TIMEOUT;
-       err->url=gopherState->request;
+    /* was assert */
+    if (entry->object_len == 0) {
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_READ_TIMEOUT;
+       err->http_status = HTTP_GATEWAY_TIMEOUT;
+       err->url = gopherState->request;
        errorAppendEntry(entry, err);
     }
     storeAbort(entry, 0);
@@ -729,26 +729,26 @@ gopherReadReply(int fd, void *data)
                gopherReadReply,
                data, 0);
        } else {
-                       /* was  assert */
-               ErrorState *err;
-               err=xcalloc(1,sizeof(ErrorState));
-               err->type=ERR_READ_ERROR;
-               err->errno=errno;
-               err->http_status=HTTP_INTERNAL_SERVER_ERROR;
-               err->url = entry->url;
-               errorAppendEntry(entry, err);
-               storeAbort(entry, 0);
-               comm_close(fd);
+           /* was  assert */
+           ErrorState *err;
+           err = xcalloc(1, sizeof(ErrorState));
+           err->type = ERR_READ_ERROR;
+           err->errno = errno;
+           err->http_status = HTTP_INTERNAL_SERVER_ERROR;
+           err->url = entry->url;
+           errorAppendEntry(entry, err);
+           storeAbort(entry, 0);
+           comm_close(fd);
        }
     } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
-               /* was assert */        
-        ErrorState *err;
-        err=xcalloc(1,sizeof(ErrorState));
-        err->type=ERR_ZERO_SIZE_OBJECT;
+       /* was assert */
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_ZERO_SIZE_OBJECT;
        err->errno = errno;
-        err->http_status=HTTP_SERVICE_UNAVAILABLE;
-       err->url=gopherState->request;
-        errorAppendEntry(entry, err);
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->url = gopherState->request;
+       errorAppendEntry(entry, err);
        storeAbort(entry, 0);
        comm_close(fd);
     } else if (len == 0) {
@@ -786,16 +786,16 @@ gopherSendComplete(int fd, char *buf, int size, int errflag, void *data)
     debug(10, 5) ("gopherSendComplete: FD %d size: %d errflag: %d\n",
        fd, size, errflag);
     if (errflag) {
-               /* was assert */
-        ErrorState *err;
-        err=xcalloc(1,sizeof(ErrorState));
-        err->type=ERR_CONNECT_FAIL;
-       err->errno=errno;
+       /* was assert */
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_CONNECT_FAIL;
+       err->errno = errno;
        err->host = xstrdup(gopherState->host);
        err->port = gopherState->port;
-        err->http_status=HTTP_SERVICE_UNAVAILABLE;
-        err->url=entry->url;
-        errorAppendEntry(entry, err);
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->url = entry->url;
+       errorAppendEntry(entry, err);
 
        storeAbort(entry, 0);
        comm_close(fd);
@@ -879,13 +879,13 @@ gopherStart(StoreEntry * entry)
     /* Parse url. */
     if (gopher_url_parser(url, gopherState->host, &gopherState->port,
            &gopherState->type_id, gopherState->request)) {
-               /* was assert */
-                ErrorState *err;
-                err=xcalloc(1,sizeof(ErrorState));
-                err->type=ERR_INVALID_URL;
-                err->http_status=HTTP_BAD_REQUEST;
-                err->url=url;
-                errorAppendEntry(entry, err);
+       /* was assert */
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_INVALID_URL;
+       err->http_status = HTTP_BAD_REQUEST;
+       err->url = url;
+       errorAppendEntry(entry, err);
 
        storeAbort(entry, 0);
        gopherStateFree(-1, gopherState);
@@ -900,14 +900,14 @@ gopherStart(StoreEntry * entry)
        url);
     if (fd == COMM_ERROR) {
        debug(10, 4) ("gopherStart: Failed because we're out of sockets.\n");
-               /* was assert */
-                err=xcalloc(1,sizeof(ErrorState));
-                err->type=ERR_SOCKET_FAILURE;
-               err->errno=errno;
-                err->http_status=HTTP_INTERNAL_SERVER_ERROR;
-               if (entry && entry->url)
-                       err->url=entry->url;
-                errorAppendEntry(entry, err);
+       /* was assert */
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_SOCKET_FAILURE;
+       err->errno = errno;
+       err->http_status = HTTP_INTERNAL_SERVER_ERROR;
+       if (entry && entry->url)
+           err->url = entry->url;
+       errorAppendEntry(entry, err);
 
        storeAbort(entry, 0);
        gopherStateFree(-1, gopherState);
@@ -922,17 +922,16 @@ gopherStart(StoreEntry * entry)
     if (!ipcache_gethostbyname(gopherState->host, 0)) {
        debug(10, 4) ("gopherStart: Called without IP entry in ipcache. OR lookup failed.\n");
        /* was assert */
-        err=xcalloc(1,sizeof(ErrorState));
-        err->type=ERR_DNS_FAIL;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_DNS_FAIL;
        err->http_status = HTTP_SERVICE_UNAVAILABLE;
-        err->dnsserver_msg = xstrdup(dns_error_message);
-        err->url=entry->url;
-        errorAppendEntry(entry, err);
+       err->dnsserver_msg = xstrdup(dns_error_message);
+       err->url = entry->url;
+       errorAppendEntry(entry, err);
        storeAbort(entry, 0);
        comm_close(fd);
        return;
     }
-
     if (((gopherState->type_id == GOPHER_INDEX) || (gopherState->type_id == GOPHER_CSO))
        && (strchr(gopherState->request, '?') == NULL)) {
        /* Index URL without query word */
@@ -967,29 +966,29 @@ gopherConnectDone(int fd, int status, void *data)
     GopherStateData *gopherState = data;
     StoreEntry *entry = gopherState->entry;
 
-       ErrorState *err;
+    ErrorState *err;
     if (status == COMM_ERR_DNS) {
        debug(10, 4) ("gopherConnectDone: Unknown host: %s\n", gopherState->host);
        /* was assert */
-        err=xcalloc(1,sizeof(ErrorState));
-        err->type=ERR_DNS_FAIL;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_DNS_FAIL;
        err->dnsserver_msg = xstrdup(dns_error_message);
-        err->http_status=HTTP_SERVICE_UNAVAILABLE;
-        err->url=entry->url;
-        errorAppendEntry(entry, err);
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->url = entry->url;
+       errorAppendEntry(entry, err);
        storeAbort(gopherState->entry, 0);
        comm_close(fd);
     } else if (status != COMM_OK) {
        /* was assert */
-        ErrorState *err;
-        err=xcalloc(1,sizeof(ErrorState));
-        err->type=ERR_CONNECT_FAIL;
-        err->http_status=HTTP_SERVICE_UNAVAILABLE;
-       err->errno= errno;
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_CONNECT_FAIL;
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->errno = errno;
        err->host = xstrdup(gopherState->host);
        err->port = gopherState->port;
-        err->url=entry->url;
-        errorAppendEntry(entry, err);
+       err->url = entry->url;
+       errorAppendEntry(entry, err);
        storeAbort(gopherState->entry, 0);
        comm_close(fd);
     } else {
index 2083063ee2bd36d383023f3c7c904efbf2cdd37a..56459f45d962e3e99d7ee6a64d28a3fbc4b0a982 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.190 1997/10/16 23:59:57 wessels Exp $
+ * $Id: http.cc,v 1.191 1997/10/17 00:00:37 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -836,31 +836,31 @@ httpBuildRequestHeader(request_t * request,
            if (orig_request->method == METHOD_TRACE) {
                for (s = xbuf + 13; *s && isspace(*s); s++);
                n = atoi(s);
-               snprintf(xbuf, 4096,  "Max-Forwards: %d", n - 1);
+               snprintf(xbuf, 4096, "Max-Forwards: %d", n - 1);
            }
        }
        httpAppendRequestHeader(hdr_out, xbuf, &len, out_sz - 512, 1);
     }
     hdr_len = t - hdr_in;
     if (Config.fake_ua && strstr(hdr_out, "User-Agent") == NULL) {
-       snprintf(ybuf,MAX_URL+32,  "User-Agent: %s", Config.fake_ua);
+       snprintf(ybuf, MAX_URL + 32, "User-Agent: %s", Config.fake_ua);
        httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 0);
     }
-    /* Append Via: */ 
-       /* snprintf would fail here too */
-    snprintf(ybuf, MAX_URL+32,  "%3.1f %s", orig_request->http_ver, ThisCache);
+    /* Append Via: */
+    /* snprintf would fail here too */
+    snprintf(ybuf, MAX_URL + 32, "%3.1f %s", orig_request->http_ver, ThisCache);
     strcat(viabuf, ybuf);
     httpAppendRequestHeader(hdr_out, viabuf, &len, out_sz, 1);
     /* Append to X-Forwarded-For: */
     strcat(fwdbuf, cfd < 0 ? "unknown" : fd_table[cfd].ipaddr);
     httpAppendRequestHeader(hdr_out, fwdbuf, &len, out_sz, 1);
     if (!EBIT_TEST(hdr_flags, HDR_HOST)) {
-       snprintf(ybuf,MAX_URL+32, "Host: %s", orig_request->host);
+       snprintf(ybuf, MAX_URL + 32, "Host: %s", orig_request->host);
        httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
     }
     if (!EBIT_TEST(cc_flags, CCC_MAXAGE)) {
        url = entry ? entry->url : urlCanonical(orig_request, NULL);
-       snprintf(ybuf, MAX_URL+32, "Cache-control: Max-age=%d", (int) getMaxAge(url));
+       snprintf(ybuf, MAX_URL + 32, "Cache-control: Max-age=%d", (int) getMaxAge(url));
        httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
        if (request->urlpath) {
            assert(strstr(url, request->urlpath));
@@ -869,9 +869,9 @@ httpBuildRequestHeader(request_t * request,
     /* maybe append Connection: Keep-Alive */
     if (BIT_TEST(flags, HTTP_KEEPALIVE)) {
        if (BIT_TEST(flags, HTTP_PROXYING)) {
-           snprintf(ybuf,MAX_URL+32, "Proxy-Connection: Keep-Alive");
+           snprintf(ybuf, MAX_URL + 32, "Proxy-Connection: Keep-Alive");
        } else {
-           snprintf(ybuf,MAX_URL+32, "Connection: Keep-Alive");
+           snprintf(ybuf, MAX_URL + 32, "Connection: Keep-Alive");
        }
        httpAppendRequestHeader(hdr_out, ybuf, &len, out_sz, 1);
     }
@@ -1277,7 +1277,7 @@ httpReplyHeader(double ver,
     int l = 0;
     int s = HTTP_REPLY_BUF_SZ;
     /* argh, ../lib/snprintf.c doesn't support '%f' */
-    snprintf(float_buf,64, "%3.1f", ver);
+    snprintf(float_buf, 64, "%3.1f", ver);
     assert(strlen(float_buf) == 3);
     l += snprintf(buf + l, s - l, "HTTP/%s %d %s\r\n",
        float_buf,
index a87cf196ffcf1b0b86bd79b6b5e5af4b5c5d3065..3e81c215047d2bb302d518e78d0979790114582b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.42 1997/10/13 22:09:12 kostas Exp $
+ * $Id: icmp.cc,v 1.43 1997/10/17 00:00:38 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -276,8 +276,8 @@ icmpOpen(void)
     }
     if (pid == 0) {            /* child */
        int tmp_s;
-       char *x = xcalloc((tmp_s=strlen(Config.debugOptions) + 32), 1);
-       snprintf(x,tmp_s, "SQUID_DEBUG=%s", Config.debugOptions);
+       char *x = xcalloc((tmp_s = strlen(Config.debugOptions) + 32), 1);
+       snprintf(x, tmp_s, "SQUID_DEBUG=%s", Config.debugOptions);
        putenv(x);
        comm_close(icmp_sock);
        dup2(child_sock, 0);
index 62ddfb7f283eadf08fc417efff89d915c68eb1c3..f77d6ed48185e5d567da7caf842d6180f36ab710 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ident.cc,v 1.33 1997/10/13 22:09:14 kostas Exp $
+ * $Id: ident.cc,v 1.34 1997/10/17 00:00:40 wessels Exp $
  *
  * DEBUG: section 30    Ident (RFC 931)
  * AUTHOR: Duane Wessels
@@ -85,7 +85,7 @@ identConnectDone(int fd, int status, void *data)
        identCallback(connState);
        return;
     }
-    snprintf(reqbuf,BUFSIZ, "%d, %d\r\n",
+    snprintf(reqbuf, BUFSIZ, "%d, %d\r\n",
        ntohs(connState->peer.sin_port),
        ntohs(connState->me.sin_port));
     comm_write(fd,
index 697605ed82ecc916291d0904518ae39ae325c9a7..ce6560cbfa6e7551d28794e98a872c3a7edfe51a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipcache.cc,v 1.130 1997/10/13 22:09:15 kostas Exp $
+ * $Id: ipcache.cc,v 1.131 1997/10/17 00:00:41 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -1105,7 +1105,7 @@ ipcacheChangeKey(ipcache_entry * i)
        debug_trap("ipcacheChangeKey: hash_remove_link() failed\n");
        return;
     }
-    snprintf(new_key,256, "%d/", ++index);
+    snprintf(new_key, 256, "%d/", ++index);
     strncat(new_key, i->name, 128);
     debug(14, 1) ("ipcacheChangeKey: from '%s' to '%s'\n", i->name, new_key);
     safe_free(i->name);
index 4e8907fb2d6f2ec6184642bfc64630584ba94091..ed4084762d5abff4bbca8da7a355fb664e8eb9fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: mime.cc,v 1.39 1997/10/16 19:22:39 kostas Exp $
+ * $Id: mime.cc,v 1.40 1997/10/17 00:00:42 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -212,16 +212,16 @@ mk_mime_hdr(char *result, const char *type, int size, time_t ttl, time_t lmt)
     expiretime = ttl ? t + ttl : 0;
     date[0] = expires[0] = last_modified[0] = '\0';
     content_length[0] = result[0] = '\0';
-    snprintf(date,100, "Date: %s\r\n", mkrfc1123(t));
+    snprintf(date, 100, "Date: %s\r\n", mkrfc1123(t));
     if (ttl >= 0)
        snprintf(expires, 100, "Expires: %s\r\n", mkrfc1123(expiretime));
     if (lmt)
-       snprintf(last_modified,100, "Last-Modified: %s\r\n", mkrfc1123(lmt));
+       snprintf(last_modified, 100, "Last-Modified: %s\r\n", mkrfc1123(lmt));
     if (size > 0)
-       snprintf(content_length,100, "Content-Length: %d\r\n", size);
+       snprintf(content_length, 100, "Content-Length: %d\r\n", size);
 
-       /* NOTE: don't know size of result thus didn't change
-          to snprintf(). Should be done sometime! */
+    /* NOTE: don't know size of result thus didn't change
+     * to snprintf(). Should be done sometime! */
 
     snprintf(result, MAX_MIME, "Server: %s/%s\r\n%s%s%sContent-Type: %s\r\n%s",
        appname,
index 6f6218bb0a95176d36954fa3d9d529a3d59e8ce6..d18df9d00ee881d9388666578d0c748a37c2d6ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: redirect.cc,v 1.46 1997/10/13 22:09:18 kostas Exp $
+ * $Id: redirect.cc,v 1.47 1997/10/17 00:00:44 wessels Exp $
  *
  * DEBUG: section 29    Redirector
  * AUTHOR: Duane Wessels
@@ -305,7 +305,7 @@ redirectDispatch(redirector_t * redirect, redirectStateData * r)
     if ((fqdn = fqdncache_gethostbyaddr(r->client_addr, 0)) == NULL)
        fqdn = dash_str;
     buf = get_free_8k_page();
-    snprintf(buf,8192, "%s %s/%s %s %s\n",
+    snprintf(buf, 8192, "%s %s/%s %s %s\n",
        r->orig_url,
        inet_ntoa(r->client_addr),
        fqdn,
index 558bb8600a5647c08091e1c1b3766d40016e5b0b..f1ddba7bc1567464c4027b1f49fc3ba3bc94df23 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: send-announce.cc,v 1.43 1997/10/13 22:09:19 kostas Exp $
+ * $Id: send-announce.cc,v 1.44 1997/10/17 00:00:45 wessels Exp $
  *
  * DEBUG: section 27    Cache Announcer
  * AUTHOR: Duane Wessels
@@ -60,16 +60,16 @@ send_announce(const ipcache_addrs * ia, void *data)
     }
     debug(27, 0) ("Sending Announcement to %s\n", host);
     sndbuf[0] = '\0';
-    snprintf(tbuf,256, "cache_version SQUID/%s\n", version_string);
+    snprintf(tbuf, 256, "cache_version SQUID/%s\n", version_string);
     strcat(sndbuf, tbuf);
     assert(Config.Port.http);
-    snprintf(tbuf,256, "Running on %s %d %d\n",
+    snprintf(tbuf, 256, "Running on %s %d %d\n",
        getMyHostname(),
        (int) Config.Port.http->i,
        (int) Config.Port.icp);
     strcat(sndbuf, tbuf);
     if (Config.adminEmail) {
-       snprintf(tbuf,256, "cache_admin: %s\n", Config.adminEmail);
+       snprintf(tbuf, 256, "cache_admin: %s\n", Config.adminEmail);
        strcat(sndbuf, tbuf);
     }
     snprintf(tbuf, 256, "generated %d [%s]\n",
index c98f130e8695b7f6c69adfa5195c4732532172a0..2418c62c497fd13cc2e887800be69507fc490e37 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.158 1997/10/17 00:00:01 wessels Exp $
+ * $Id: stat.cc,v 1.159 1997/10/17 00:00:46 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -276,7 +276,7 @@ static const char *
 describeStatuses(const StoreEntry * entry)
 {
     LOCAL_ARRAY(char, buf, 256);
-    snprintf(buf,256, "%-13s %-13s %-12s %-12s",
+    snprintf(buf, 256, "%-13s %-13s %-12s %-12s",
        storeStatusStr[entry->store_status],
        memStatusStr[entry->mem_status],
        swapStatusStr[entry->swap_status],
@@ -322,7 +322,7 @@ static const char *
 describeTimestamps(const StoreEntry * entry)
 {
     LOCAL_ARRAY(char, buf, 256);
-    snprintf(buf,256, "LV:%-9d LU:%-9d LM:%-9d EX:%-9d",
+    snprintf(buf, 256, "LV:%-9d LU:%-9d LM:%-9d EX:%-9d",
        (int) entry->timestamp,
        (int) entry->lastref,
        (int) entry->lastmod,
index de4ad505a2bed2a811c6e12ea8e1faa7da582a83..79349d2676d71e3dd6e969988022e757e319385f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.286 1997/10/17 00:00:03 wessels Exp $
+ * $Id: store.cc,v 1.287 1997/10/17 00:00:47 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -2697,7 +2697,7 @@ static void
 storeInMemAdd(StoreEntry * e)
 {
     struct _mem_entry *m = xmalloc(sizeof(struct _mem_entry));
-    debug(0,0)("storeInMemAdd: %s\n", e->url);
+    debug(0, 0) ("storeInMemAdd: %s\n", e->url);
     m->e = e;
     m->prev = NULL;
     m->next = inmem_head;
@@ -2718,7 +2718,7 @@ storeInMemDelete(StoreEntry * e)
            break;
     }
     assert(m != NULL);
-    debug(0,0)("storeInMemDelete: %s\n", e->url);
+    debug(0, 0) ("storeInMemDelete: %s\n", e->url);
     if (m->next)
        m->next->prev = m->prev;
     if (m->prev)
index aebf9b7451299a347c5477f66aa559f38779af2b..39dcb711a630490f8e773135a9b556546d1cdb3e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.29 1997/10/16 19:22:41 kostas Exp $
+ * $Id: store_dir.cc,v 1.30 1997/10/17 00:00:48 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -46,7 +46,7 @@ storeSwapFullPath(int fn, char *fullpath)
     if (!fullpath)
        fullpath = fullfilename;
     fullpath[0] = '\0';
-    snprintf(fullpath,SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X",
+    snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X",
        Config.cacheSwap.swapDirs[dirn].path,
        filn % Config.cacheSwap.swapDirs[dirn].l1,
        filn / Config.cacheSwap.swapDirs[dirn].l1 % Config.cacheSwap.swapDirs[dirn].l2,
@@ -64,7 +64,7 @@ storeSwapSubSubDir(int fn, char *fullpath)
     if (!fullpath)
        fullpath = fullfilename;
     fullpath[0] = '\0';
-    snprintf(fullpath,SQUID_MAXPATHLEN, "%s/%02X/%02X",
+    snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X",
        Config.cacheSwap.swapDirs[dirn].path,
        filn % Config.cacheSwap.swapDirs[dirn].l1,
        filn / Config.cacheSwap.swapDirs[dirn].l1 % Config.cacheSwap.swapDirs[dirn].l2);
@@ -81,9 +81,9 @@ storeVerifyOrCreateDir(const char *path)
     }
     safeunlink(path, 1);
     if (mkdir(path, 0777) < 0) {
-       if (errno != EEXIST) {    
-         /* NOTE: couldn't figure size of tmp_error_buf, assumed
-               ERROR_BUF_SZ */
+       if (errno != EEXIST) {
+           /* NOTE: couldn't figure size of tmp_error_buf, assumed
+            * ERROR_BUF_SZ */
            snprintf(tmp_error_buf, ERROR_BUF_SZ,
                "Failed to create swap directory %s: %s",
                path,
@@ -93,9 +93,9 @@ storeVerifyOrCreateDir(const char *path)
     }
     debug(47, 1) ("Created directory %s\n", path);
     if (stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) {
-          /* NOTE: couldn't figure size of tmp_error_buf, assumed
-                ERROR_BUF_SZ */
-       snprintf(tmp_error_buf, ERROR_BUF_SZ, 
+       /* NOTE: couldn't figure size of tmp_error_buf, assumed
+        * ERROR_BUF_SZ */
+       snprintf(tmp_error_buf, ERROR_BUF_SZ,
            "Failed to create directory %s: %s", path, xstrerror());
        fatal(tmp_error_buf);
     }
@@ -124,7 +124,7 @@ storeCreateSwapSubDirs(int j)
     SwapDir *SD = &Config.cacheSwap.swapDirs[j];
     LOCAL_ARRAY(char, name, MAXPATHLEN);
     for (i = 0; i < SD->l1; i++) {
-       snprintf(name,MAXPATHLEN, "%s/%02X", SD->path, i);
+       snprintf(name, MAXPATHLEN, "%s/%02X", SD->path, i);
        if (storeVerifyOrCreateDir(name) == 0)
            continue;
        debug(47, 1) ("Making directories in %s\n", name);
@@ -224,7 +224,7 @@ storeDirSwapLog(const StoreEntry * e)
     if (BIT_TEST(e->flag, KEY_PRIVATE))
        debug(0, 0) ("storeDirSwapLog: PRIVATE: %s\n", e->url);
     /* Note this printf format appears in storeWriteCleanLog() too */
-    snprintf(logmsg, MAX_URL << 1 , "%08x %08x %08x %08x %08x %9d %6d %08x %s\n",
+    snprintf(logmsg, MAX_URL << 1, "%08x %08x %08x %08x %08x %9d %6d %08x %s\n",
        (int) e->swap_file_number,
        (int) e->timestamp,
        (int) e->lastref,
index 243262c3ea546608ecdfc87756f54765b0168dd4..c524042f1b6defa11a2bd85298393af732ea09e9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.122 1997/10/16 19:22:41 kostas Exp $
+ * $Id: tools.cc,v 1.123 1997/10/17 00:00:49 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -149,7 +149,7 @@ static char *
 dead_msg(void)
 {
     LOCAL_ARRAY(char, msg, 1024);
-    snprintf(msg,1024, DEAD_MSG, version_string, version_string);
+    snprintf(msg, 1024, DEAD_MSG, version_string, version_string);
     return msg;
 }
 
@@ -167,7 +167,7 @@ mail_warranty(void)
     fprintf(fp, "To: %s\n", Config.adminEmail);
     fprintf(fp, "Subject: %s\n", dead_msg());
     fclose(fp);
-    snprintf(command,256, "mail %s < %s", Config.adminEmail, filename);
+    snprintf(command, 256, "mail %s < %s", Config.adminEmail, filename);
     system(command);           /* XXX should avoid system(3) */
     unlink(filename);
 }
@@ -609,7 +609,7 @@ writePidFile(void)
        debug_trap("Could not write pid file");
        return;
     }
-    snprintf(buf,32, "%d\n", (int) getpid());
+    snprintf(buf, 32, "%d\n", (int) getpid());
     write(fd, buf, strlen(buf));
     file_close(fd);
 }
@@ -659,10 +659,10 @@ setMaxFD(void)
        if (rl.rlim_cur > rl.rlim_max)
            Squid_MaxFD = rl.rlim_cur = rl.rlim_max;
        if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
-          /* NOTE: couldn't figure size of tmp_error_buf, thus 
-                 assuming ERROR_BUF_SZ */
-           snprintf(tmp_error_buf, ERROR_BUF_SZ, 
-                       "setrlimit: RLIMIT_NOFILE: %s", xstrerror());
+           /* NOTE: couldn't figure size of tmp_error_buf, thus 
+            * assuming ERROR_BUF_SZ */
+           snprintf(tmp_error_buf, ERROR_BUF_SZ,
+               "setrlimit: RLIMIT_NOFILE: %s", xstrerror());
            fatal_dump(tmp_error_buf);
        }
     }
@@ -674,10 +674,10 @@ setMaxFD(void)
        if (rl.rlim_cur > rl.rlim_max)
            Squid_MaxFD = rl.rlim_cur = rl.rlim_max;
        if (setrlimit(RLIMIT_OFILE, &rl) < 0) {
-          /* NOTE: couldn't figure size of tmp_error_buf, thus
-                assuming ERROR_BUF_SZ  */
-           snprintf(tmp_error_buf, ERROR_BUF_SZ, 
-                       "setrlimit: RLIMIT_OFILE: %s", xstrerror());
+           /* NOTE: couldn't figure size of tmp_error_buf, thus
+            * assuming ERROR_BUF_SZ  */
+           snprintf(tmp_error_buf, ERROR_BUF_SZ,
+               "setrlimit: RLIMIT_OFILE: %s", xstrerror());
            fatal_dump(tmp_error_buf);
        }
     }
@@ -692,10 +692,10 @@ setMaxFD(void)
     } else if (rl.rlim_max > rl.rlim_cur) {
        rl.rlim_cur = rl.rlim_max;      /* set it to the max */
        if (setrlimit(RLIMIT_DATA, &rl) < 0) {
-          /* NOTE: couldn't figure size of tmp_error_buf, thus d
-                assuming ERROR_BUF_SZ  */
-           snprintf(tmp_error_buf, ERROR_BUF_SZ, 
-                       "setrlimit: RLIMIT_DATA: %s", xstrerror());
+           /* NOTE: couldn't figure size of tmp_error_buf, thus d
+            * assuming ERROR_BUF_SZ  */
+           snprintf(tmp_error_buf, ERROR_BUF_SZ,
+               "setrlimit: RLIMIT_DATA: %s", xstrerror());
            fatal_dump(tmp_error_buf);
        }
     }
@@ -706,10 +706,10 @@ setMaxFD(void)
     } else if (rl.rlim_max > rl.rlim_cur) {
        rl.rlim_cur = rl.rlim_max;      /* set it to the max */
        if (setrlimit(RLIMIT_VMEM, &rl) < 0) {
-          /* NOTE: couldn't figure size of tmp_error_buf, thus 
-                assuming ERROR_BUF_SZ  */
-           snprintf(tmp_error_buf, ERROR_BUF_SZ, 
-                       "setrlimit: RLIMIT_VMEM: %s", xstrerror());
+           /* NOTE: couldn't figure size of tmp_error_buf, thus 
+            * assuming ERROR_BUF_SZ  */
+           snprintf(tmp_error_buf, ERROR_BUF_SZ,
+               "setrlimit: RLIMIT_VMEM: %s", xstrerror());
            fatal_dump(tmp_error_buf);
        }
     }
index ffae27e7fb5c9cbc36a6fb489b1fbbcae732139e..dc6ed235e78511a28e4d42ee529449d1c5cd2ad8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: url.cc,v 1.64 1997/10/13 22:09:25 kostas Exp $
+ * $Id: url.cc,v 1.65 1997/10/17 00:00:49 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -280,12 +280,12 @@ urlCanonical(const request_t * request, char *buf)
        buf = urlbuf;
     switch (request->method) {
     case METHOD_CONNECT:
-       snprintf(buf,MAX_URL, "%s:%d", request->host, request->port);
+       snprintf(buf, MAX_URL, "%s:%d", request->host, request->port);
        break;
     default:
        portbuf[0] = '\0';
        if (request->port != urlDefaultPort(request->protocol))
-           snprintf(portbuf,32,  ":%d", request->port);
+           snprintf(portbuf, 32, ":%d", request->port);
        snprintf(buf, MAX_URL, "%s://%s%s%s%s%s",
            ProtocolStr[request->protocol],
            request->login,
@@ -311,8 +311,8 @@ urlCanonicalClean(const request_t * request)
     default:
        portbuf[0] = '\0';
        if (request->port != urlDefaultPort(request->protocol))
-           snprintf(portbuf,32, ":%d", request->port);
-       snprintf(buf,MAX_URL, "%s://%s%s%s",
+           snprintf(portbuf, 32, ":%d", request->port);
+       snprintf(buf, MAX_URL, "%s://%s%s%s",
            ProtocolStr[request->protocol],
            request->host,
            portbuf,
index 31743de26837bbb29d50f2d242bdc4e92814d400..e0b86fc88056062634e586d7188f3c7371ba8903 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: useragent.cc,v 1.11 1997/10/13 22:09:26 kostas Exp $
+ * $Id: useragent.cc,v 1.12 1997/10/17 00:00:50 wessels Exp $
  *
  * DEBUG: section 40    User-Agent logging
  * AUTHOR: Joe Ramey <ramey@csc.ti.com>
@@ -81,8 +81,8 @@ useragentRotateLog(void)
     /* Rotate numbers 0 through N up one */
     for (i = Config.Log.rotateNumber; i > 1;) {
        i--;
-       snprintf(from,MAXPATHLEN, "%s.%d", fname, i - 1);
-       snprintf(to,MAXPATHLEN, "%s.%d", fname, i);
+       snprintf(from, MAXPATHLEN, "%s.%d", fname, i - 1);
+       snprintf(to, MAXPATHLEN, "%s.%d", fname, i);
        rename(from, to);
     }
     /* Rotate the current log to .0 */
index a1e2d0ad67af43fadced24c181bc2c0d1247fe05..7ef30bbc0e5fd452670616fbbcad959c698fceae 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.84 1997/10/17 00:00:05 wessels Exp $
+ * $Id: wais.cc,v 1.85 1997/10/17 00:00:51 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -143,7 +143,7 @@ waisTimeout(int fd, void *data)
     ErrorState *err;
     StoreEntry *entry = waisState->entry;
     debug(24, 4) ("waisTimeout: FD %d: '%s'\n", fd, entry->url);
-       /* was assert */
+    /* was assert */
     err = xcalloc(1, sizeof(ErrorState));
     err->type = ERR_READ_TIMEOUT;
     err->http_status = HTTP_GATEWAY_TIMEOUT;
@@ -169,12 +169,12 @@ waisReadReply(int fd, void *data)
     int off;
     int bin;
     if (protoAbortFetch(entry)) {
-       ErrorState *err;
-       err = xcalloc(1, sizeof(ErrorState));
-       err->type = ERR_CLIENT_ABORT;
-       err->http_status = HTTP_INTERNAL_SERVER_ERROR;
-       err->request = urlParse(METHOD_CONNECT, waisState->request);
-       errorAppendEntry(entry, err);
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_CLIENT_ABORT;
+       err->http_status = HTTP_INTERNAL_SERVER_ERROR;
+       err->request = urlParse(METHOD_CONNECT, waisState->request);
+       errorAppendEntry(entry, err);
        storeAbort(entry, 0);
        comm_close(fd);
        return;
@@ -222,29 +222,29 @@ waisReadReply(int fd, void *data)
            commSetSelect(fd, COMM_SELECT_READ,
                waisReadReply, waisState, 0);
        } else {
-               ErrorState *err;
+           ErrorState *err;
            BIT_RESET(entry->flag, ENTRY_CACHABLE);
            storeReleaseRequest(entry);
-       /* was assert */
+           /* was assert */
 
-            err = xcalloc(1, sizeof(ErrorState));
-            err->type = ERR_READ_ERROR;
-            err->http_status = HTTP_INTERNAL_SERVER_ERROR;
-            err->request = urlParse(METHOD_CONNECT, waisState->request);
-            errorAppendEntry(entry, err);
+           err = xcalloc(1, sizeof(ErrorState));
+           err->type = ERR_READ_ERROR;
+           err->http_status = HTTP_INTERNAL_SERVER_ERROR;
+           err->request = urlParse(METHOD_CONNECT, waisState->request);
+           errorAppendEntry(entry, err);
 
            storeAbort(entry, 0);
            comm_close(fd);
        }
     } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
-               /* was assert */
-            ErrorState *err;
-            err = xcalloc(1, sizeof(ErrorState));
-            err->type = ERR_ZERO_SIZE_OBJECT;
-            err->errno = errno;
-            err->http_status = HTTP_SERVICE_UNAVAILABLE;
-            err->request = urlParse(METHOD_CONNECT, waisState->request);
-            errorAppendEntry(entry, err);
+       /* was assert */
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_ZERO_SIZE_OBJECT;
+       err->errno = errno;
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->request = urlParse(METHOD_CONNECT, waisState->request);
+       errorAppendEntry(entry, err);
        storeAbort(entry, 0);
        comm_close(fd);
     } else if (len == 0) {
@@ -272,15 +272,15 @@ waisSendComplete(int fd, char *buf, int size, int errflag, void *data)
        fd, size, errflag);
     if (errflag) {
        /* was assert */
-            ErrorState *err;
-            err = xcalloc(1, sizeof(ErrorState));
-            err->type = ERR_CONNECT_FAIL;
-            err->errno=errno;
-            err->host =xstrdup(waisState->relayhost);
-            err->port = waisState->relayport;
-            err->http_status = HTTP_SERVICE_UNAVAILABLE;
-            err->request = urlParse(METHOD_CONNECT, waisState->request);
-            errorAppendEntry(entry, err);
+       ErrorState *err;
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_CONNECT_FAIL;
+       err->errno = errno;
+       err->host = xstrdup(waisState->relayhost);
+       err->port = waisState->relayport;
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->request = urlParse(METHOD_CONNECT, waisState->request);
+       errorAppendEntry(entry, err);
 
        storeAbort(entry, 0);
        comm_close(fd);
@@ -312,10 +312,10 @@ waisSendRequest(int fd, void *data)
     buf = xcalloc(1, len + 1);
 
     if (waisState->request_hdr)
-       snprintf(buf, len+1, "%s %s %s\r\n", Method, waisState->request,
+       snprintf(buf, len + 1, "%s %s %s\r\n", Method, waisState->request,
            waisState->request_hdr);
     else
-       snprintf(buf, len+1, "%s %s\r\n", Method, waisState->request);
+       snprintf(buf, len + 1, "%s %s\r\n", Method, waisState->request);
     debug(24, 6) ("waisSendRequest: buf: %s\n", buf);
     comm_write(fd,
        buf,
@@ -336,14 +336,14 @@ waisStart(request_t * request, StoreEntry * entry)
     method_t method = request->method;
     debug(24, 3) ("waisStart: \"%s %s\"\n", RequestMethodStr[method], url);
     if (!Config.Wais.relayHost) {
-        ErrorState *err;
+       ErrorState *err;
        debug(24, 0) ("waisStart: Failed because no relay host defined!\n");
        /* was assert */
-        err = xcalloc(1, sizeof(ErrorState));
-        err->type = ERR_NO_RELAY;
-        err->http_status = HTTP_INTERNAL_SERVER_ERROR;
-        err->request = urlParse(METHOD_CONNECT, waisState->request);
-        errorAppendEntry(entry, err);
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_NO_RELAY;
+       err->http_status = HTTP_INTERNAL_SERVER_ERROR;
+       err->request = urlParse(METHOD_CONNECT, waisState->request);
+       errorAppendEntry(entry, err);
 
        storeAbort(entry, 0);
        return;
@@ -355,14 +355,14 @@ waisStart(request_t * request, StoreEntry * entry)
        COMM_NONBLOCKING,
        url);
     if (fd == COMM_ERROR) {
-        ErrorState *err;
+       ErrorState *err;
        debug(24, 4) ("waisStart: Failed because we're out of sockets.\n");
        /* was assert */
-        err = xcalloc(1, sizeof(ErrorState));
-        err->type = ERR_SOCKET_FAILURE;
-        err->http_status = HTTP_INTERNAL_SERVER_ERROR;
-        err->request = urlParse(METHOD_CONNECT, waisState->request);
-        errorAppendEntry(entry, err);
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_SOCKET_FAILURE;
+       err->http_status = HTTP_INTERNAL_SERVER_ERROR;
+       err->request = urlParse(METHOD_CONNECT, waisState->request);
+       errorAppendEntry(entry, err);
        storeAbort(entry, 0);
        return;
     }
@@ -395,24 +395,24 @@ waisConnectDone(int fd, int status, void *data)
 
     if (status == COMM_ERR_DNS) {
        /* was assert */
-        err = xcalloc(1, sizeof(ErrorState));
-        err->type = ERR_DNS_FAIL;
-        err->http_status = HTTP_SERVICE_UNAVAILABLE;
-        err->dnsserver_msg = xstrdup(dns_error_message);
-        err->request = urlParse(METHOD_CONNECT, request);
-        errorAppendEntry(waisState->entry, err);
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_DNS_FAIL;
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->dnsserver_msg = xstrdup(dns_error_message);
+       err->request = urlParse(METHOD_CONNECT, request);
+       errorAppendEntry(waisState->entry, err);
        storeAbort(waisState->entry, 0);
        comm_close(fd);
     } else if (status != COMM_OK) {
        /* was assert */
-        err = xcalloc(1, sizeof(ErrorState));
-        err->type = ERR_CONNECT_FAIL;
-        err->http_status = HTTP_SERVICE_UNAVAILABLE;
-        err->errno = errno;
-        err->host = xstrdup(waisState->relayhost);
-        err->port = waisState->relayport;
-        err->request = urlParse(METHOD_CONNECT, request);
-        errorAppendEntry(waisState->entry, err);
+       err = xcalloc(1, sizeof(ErrorState));
+       err->type = ERR_CONNECT_FAIL;
+       err->http_status = HTTP_SERVICE_UNAVAILABLE;
+       err->errno = errno;
+       err->host = xstrdup(waisState->relayhost);
+       err->port = waisState->relayport;
+       err->request = urlParse(METHOD_CONNECT, request);
+       errorAppendEntry(waisState->entry, err);
        storeAbort(waisState->entry, 0);
        comm_close(fd);
     } else {