]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Sat, 19 Jul 1997 13:19:59 +0000 (13:19 +0000)
committerwessels <>
Sat, 19 Jul 1997 13:19:59 +0000 (13:19 +0000)
lib/snprintf.c
src/cache_cf.cc
src/client.cc
src/defines.h
src/main.cc
src/mime.cc
src/peer_select.cc

index 75bb6861271e5c93588782b3042dcc232e79b5d2..219244acd4ae343287ab40309857adb5f785bdf4 100644 (file)
@@ -13,7 +13,7 @@
  **************************************************************/
 
 /* Original RCS tag:
-  Id: snprintf.c,v 1.1 1995/08/19 20:36:09 papowell Exp */
* Id: snprintf.c,v 1.1 1995/08/19 20:36:09 papowell Exp */
 
 static void dopr();
 static char *end;
index edba0ae04b5d93b4343f667153a241cdbb1a4aef..11578cde4ffbe71a106a5fd5c14bc7ea44309044 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.215 1997/07/19 02:56:35 wessels Exp $
+ * $Id: cache_cf.cc,v 1.216 1997/07/19 07:20:00 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -490,7 +490,7 @@ parse_peer(peer ** head)
     peer *p;
     int i;
     ushortlist *u;
-    const char *me = null_string; /* XXX */
+    const char *me = null_string;      /* XXX */
     p = xcalloc(1, sizeof(peer));
     p->http_port = CACHE_HTTP_PORT;
     p->icp_port = CACHE_ICP_PORT;
index b0931a30858f7f992eb947835cef9b7fd35bec2f..7c128b88f524a4737a83c7b54293ed8e19c8d915 100644 (file)
@@ -1,8 +1,9 @@
 
 
 
+
 /*
- * $Id: client.cc,v 1.21 1997/07/16 22:58:23 wessels Exp $
+ * $Id: client.cc,v 1.22 1997/07/19 07:20:01 wessels Exp $
  *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
index 780c0df6982719a37c942522961aa104edae8a05..659945d39c8c65dd6ba91a24a726a27fcfce0808 100644 (file)
@@ -97,7 +97,7 @@
 #undef  HASH_SIZE 65357                /* prime number < 65536 */
 #endif
 
-#define  DEFAULT_HASH_SIZE 7951                /* prime number < 8192 */
+#define  DEFAULT_HASH_SIZE 7951        /* prime number < 8192 */
 
 #define HTTP_REPLY_FIELD_SZ 128
 
index cc6fc605d965dad1ee206fae9cf616ce4f68d053..4dccdf3e055f946d27ced15dc3ac35612abc9321 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.166 1997/07/19 02:56:38 wessels Exp $
+ * $Id: main.cc,v 1.167 1997/07/19 07:20:02 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -593,7 +593,6 @@ main(int argc, char **argv)
        sendSignal();
        /* NOTREACHED */
     }
-
     setMaxFD();
 
     if (opt_catch_signals)
index bf306124a60c38bd0b4921b89abfba27215a3e05..0413bcdd18544e363dd11c1e75f847bac3312f5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: mime.cc,v 1.34 1997/07/19 07:18:01 wessels Exp $
+ * $Id: mime.cc,v 1.35 1997/07/19 07:20:03 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -384,52 +384,52 @@ mimeInit(char *filename)
 static void
 mimeLoadIconFile(const char *icon)
 {
-       int fd;
-       int n;
-       int l;
-       struct stat sb;
-       StoreEntry *e;
-       LOCAL_ARRAY(char, path, MAXPATHLEN);
-       LOCAL_ARRAY(char, url, MAX_URL);
-       char *buf;
-       snprintf(url, MAX_URL, "http://internal.squid/icons/%s", icon);
-       if (storeGet(url))
-               return;
-       snprintf(path, MAXPATHLEN, "%s/%s", Config.icons.directory, icon);
-       fd = file_open(path, O_RDONLY, NULL, NULL);
-       if (fd < 0) {
-               debug(25,0)("mimeLoadIconFile: %s: %s\n", path, xstrerror());
-               return;
-       }
-       if (fstat(fd, &sb) < 0) {
-               debug(50,0)("mimeLoadIconFile: FD %d: fstat: %s\n", fd, xstrerror());
-               return;
-       }
-       e = storeCreateEntry(url,
-               url,
-               REQ_CACHABLE,
-               METHOD_GET);
-       assert(e != NULL);
-       e->mem_obj->request = requestLink(urlParse(METHOD_GET, url));
-       buf = get_free_4k_page();
-       l = 0;
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "HTTP/1.0 200 OK\r\n");
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "Date: %s\r\n", mkrfc1123(squid_curtime));
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "Server: Squid/%s\r\n", version_string);
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "Content-Type: %s\r\n", Config.icons.content_type);
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "Content-Length: %d\r\n", (int) sb.st_size);
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "Last-Modified: %s\r\n", mkrfc1123(sb.st_mtime));
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "Expires: %s\r\n", mkrfc1123(squid_curtime + 86400));
-       l += snprintf(buf+l, SM_PAGE_SIZE-l, "\r\n");
-       httpParseReplyHeaders(buf, e->mem_obj->reply);
-       storeAppend(e, buf, l);
-       while ((n = read(fd, buf, SM_PAGE_SIZE)) > 0)
-               storeAppend(e, buf, n);
-       file_close(fd);
-       storeSetPublicKey(e);
-       storeComplete(e);
-       storeTimestampsSet(e);
-       BIT_SET(e->flag, ENTRY_SPECIAL);
-       debug(25,1)("Loaded icon %s\n", url);
-       put_free_4k_page(buf);
+    int fd;
+    int n;
+    int l;
+    struct stat sb;
+    StoreEntry *e;
+    LOCAL_ARRAY(char, path, MAXPATHLEN);
+    LOCAL_ARRAY(char, url, MAX_URL);
+    char *buf;
+    snprintf(url, MAX_URL, "http://internal.squid/icons/%s", icon);
+    if (storeGet(url))
+       return;
+    snprintf(path, MAXPATHLEN, "%s/%s", Config.icons.directory, icon);
+    fd = file_open(path, O_RDONLY, NULL, NULL);
+    if (fd < 0) {
+       debug(25, 0) ("mimeLoadIconFile: %s: %s\n", path, xstrerror());
+       return;
+    }
+    if (fstat(fd, &sb) < 0) {
+       debug(50, 0) ("mimeLoadIconFile: FD %d: fstat: %s\n", fd, xstrerror());
+       return;
+    }
+    e = storeCreateEntry(url,
+       url,
+       REQ_CACHABLE,
+       METHOD_GET);
+    assert(e != NULL);
+    e->mem_obj->request = requestLink(urlParse(METHOD_GET, url));
+    buf = get_free_4k_page();
+    l = 0;
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "HTTP/1.0 200 OK\r\n");
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "Date: %s\r\n", mkrfc1123(squid_curtime));
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "Server: Squid/%s\r\n", version_string);
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "Content-Type: %s\r\n", Config.icons.content_type);
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "Content-Length: %d\r\n", (int) sb.st_size);
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "Last-Modified: %s\r\n", mkrfc1123(sb.st_mtime));
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "Expires: %s\r\n", mkrfc1123(squid_curtime + 86400));
+    l += snprintf(buf + l, SM_PAGE_SIZE - l, "\r\n");
+    httpParseReplyHeaders(buf, e->mem_obj->reply);
+    storeAppend(e, buf, l);
+    while ((n = read(fd, buf, SM_PAGE_SIZE)) > 0)
+       storeAppend(e, buf, n);
+    file_close(fd);
+    storeSetPublicKey(e);
+    storeComplete(e);
+    storeTimestampsSet(e);
+    BIT_SET(e->flag, ENTRY_SPECIAL);
+    debug(25, 1) ("Loaded icon %s\n", url);
+    put_free_4k_page(buf);
 }
index 91d315b6478f574ea174620f51fa63be2b5d32fc..4ab113309e7ba96867780a19e9dfcbf61af68fbc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.22 1997/07/19 04:01:24 wessels Exp $
+ * $Id: peer_select.cc,v 1.23 1997/07/19 07:20:04 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -58,10 +58,11 @@ static struct {
     int timeouts;
 } PeerStats;
 
-static char *DirectStr[] = {
-       "DIRECT_NO",
-       "DIRECT_MAYBE",
-       "DIRECT_YES"
+static char *DirectStr[] =
+{
+    "DIRECT_NO",
+    "DIRECT_MAYBE",
+    "DIRECT_YES"
 };
 
 static void peerSelectFoo _PARAMS((ps_state *));
@@ -88,7 +89,7 @@ peerSelectIcpPing(request_t * request, int direct, StoreEntry * entry)
     int n;
     if (entry == NULL)
        return 0;
-    debug(44,3)("peerSelectIcpPing: %s\n", entry->url);
+    debug(44, 3) ("peerSelectIcpPing: %s\n", entry->url);
     if (entry->ping_status != PING_NONE)
        return 0;
     if (direct == DIRECT_YES)
@@ -102,7 +103,7 @@ peerSelectIcpPing(request_t * request, int direct, StoreEntry * entry)
        if (direct != DIRECT_NO)
            return 0;
     n = neighborsCount(request);
-    debug(44,3)("peerSelectIcpPing: counted %d neighbors\n", n);
+    debug(44, 3) ("peerSelectIcpPing: counted %d neighbors\n", n);
     return n;
 }
 
@@ -139,9 +140,9 @@ peerSelect(request_t * request,
 {
     ps_state *psstate = xcalloc(1, sizeof(ps_state));
     if (entry)
-        debug(44,3)("peerSelect: %s\n", entry->url);
+       debug(44, 3) ("peerSelect: %s\n", entry->url);
     else
-        debug(44,3)("peerSelect: %s\n", RequestMethodStr[request->method]);
+       debug(44, 3) ("peerSelect: %s\n", RequestMethodStr[request->method]);
     cbdataAdd(psstate);
     psstate->request = requestLink(request);
     psstate->entry = entry;
@@ -179,7 +180,7 @@ peerSelectCallback(ps_state * psstate, peer * p)
     StoreEntry *entry = psstate->entry;
     void *data = psstate->callback_data;
     if (entry) {
-        debug(44, 3) ("peerSelectCallback: %s\n", entry->url);
+       debug(44, 3) ("peerSelectCallback: %s\n", entry->url);
        if (entry->ping_status == PING_WAITING)
            eventDelete(peerPingTimeout, psstate);
        entry->ping_status = PING_DONE;
@@ -300,7 +301,7 @@ peerPingTimeout(void *data)
     ps_state *psstate = data;
     StoreEntry *entry = psstate->entry;
     if (entry)
-        debug(44, 3) ("peerPingTimeout: '%s'\n", entry->url);
+       debug(44, 3) ("peerPingTimeout: '%s'\n", entry->url);
     entry->ping_status = PING_TIMEOUT;
     PeerStats.timeouts++;
     psstate->icp.timeout = 1;
@@ -320,7 +321,7 @@ peerHandleIcpReply(peer * p, peer_t type, icp_opcode op, void *data)
     ps_state *psstate = data;
     int w_rtt;
     request_t *request = psstate->request;
-    debug(44,3)("peerHandleIcpReply: %s %s\n",
+    debug(44, 3) ("peerHandleIcpReply: %s %s\n",
        IcpOpcodeStr[op],
        psstate->entry->url);
     psstate->icp.n_recv++;