]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl
authorwessels <>
Mon, 1 Apr 2002 12:59:50 +0000 (12:59 +0000)
committerwessels <>
Mon, 1 Apr 2002 12:59:50 +0000 (12:59 +0000)
src/client_side.cc
src/comm.cc
src/protos.h
src/structs.h

index bdd5e2449ba20d056e7433ffe684dbec5d9e8521..52ba2f1d90b594a5bc595297a8c8768fa6beb795 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.565 2002/03/07 12:11:26 adrian Exp $
+ * $Id: client_side.cc,v 1.566 2002/04/01 05:59:50 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -212,7 +212,7 @@ clientCreateStoreEntry(clientHttpRequest * h, method_t m, request_flags flags)
     /* h->reqbuf = h->norm_reqbuf; */
     assert(h->reqbuf == h->norm_reqbuf);
     storeClientCopy(h->sc, e, 0, HTTP_REQBUF_SZ, h->reqbuf,
-      clientSendMoreData, h);
+       clientSendMoreData, h);
     return e;
 }
 
@@ -480,9 +480,9 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size)
        storeUnlockObject(entry);
        entry = http->entry = http->old_entry;
        http->sc = http->old_sc;
-        http->reqbuf = http->norm_reqbuf;
-        http->reqofs = http->old_reqofs;
-        http->reqsize = http->old_reqsize;
+       http->reqbuf = http->norm_reqbuf;
+       http->reqofs = http->old_reqofs;
+       http->reqsize = http->old_reqsize;
     } else if (STORE_PENDING == entry->store_status && 0 == status) {
        debug(33, 3) ("clientHandleIMSReply: Incomplete headers for '%s'\n", url);
        if (size + http->reqofs >= HTTP_REQBUF_SZ) {
@@ -494,12 +494,12 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size)
            storeUnlockObject(entry);
            entry = http->entry = http->old_entry;
            http->sc = http->old_sc;
-            http->reqbuf = http->norm_reqbuf;
-            http->reqofs = http->old_reqofs;
-            http->reqsize = http->old_reqsize;
+           http->reqbuf = http->norm_reqbuf;
+           http->reqofs = http->old_reqofs;
+           http->reqsize = http->old_reqsize;
            /* continue */
        } else {
-            http->reqofs += size;
+           http->reqofs += size;
            storeClientCopy(http->sc, entry,
                http->out.offset + http->reqofs,
                HTTP_REQBUF_SZ - http->reqofs,
@@ -533,9 +533,9 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size)
            requestUnlink(entry->mem_obj->request);
            entry->mem_obj->request = NULL;
        }
-        http->reqbuf = http->norm_reqbuf;
-        http->reqofs = http->old_reqofs;
-        http->reqsize = http->old_reqsize;
+       http->reqbuf = http->norm_reqbuf;
+       http->reqofs = http->old_reqofs;
+       http->reqsize = http->old_reqsize;
     } else {
        /* the client can handle this reply, whatever it is */
        http->log_type = LOG_TCP_REFRESH_MISS;
@@ -626,7 +626,7 @@ clientPurgeRequest(clientHttpRequest * http)
            http->entry->mem_obj->method = http->request->method;
            http->sc = storeClientListAdd(http->entry, http);
            http->log_type = LOG_TCP_HIT;
-            http->reqofs = 0;
+           http->reqofs = 0;
            storeClientCopy(http->sc, http->entry,
                http->out.offset,
                HTTP_REQBUF_SZ,
@@ -940,17 +940,17 @@ clientInterpretRequestHeaders(clientHttpRequest * http)
     }
     /* ignore range header in non-GETs */
     if (request->method == METHOD_GET) {
-       /*
-        * Since we're not doing ranges atm, just set the flag if
-        * the header exists, and then free the range header info
-        * -- adrian
-        */
-       request->range = httpHeaderGetRange(req_hdr);
-       if (request->range) {
-           request->flags.range = 1;
-           httpHdrRangeDestroy(request->range);
-           request->range = NULL;
-       }
+       /*
+        * Since we're not doing ranges atm, just set the flag if
+        * the header exists, and then free the range header info
+        * -- adrian
+        */
+       request->range = httpHeaderGetRange(req_hdr);
+       if (request->range) {
+           request->flags.range = 1;
+           httpHdrRangeDestroy(request->range);
+           request->range = NULL;
+       }
     }
     if (httpHeaderHas(req_hdr, HDR_AUTHORIZATION))
        request->flags.auth = 1;
@@ -1298,8 +1298,8 @@ clientCacheHit(void *data, char *buf, ssize_t size)
            clientProcessMiss(http);
        } else {
            debug(33, 3) ("clientCacheHit: waiting for HTTP reply headers\n");
-            http->reqofs += size;
-            assert(http->reqofs <= HTTP_REQBUF_SZ);
+           http->reqofs += size;
+           assert(http->reqofs <= HTTP_REQBUF_SZ);
            storeClientCopy(http->sc, e,
                http->out.offset + http->reqofs,
                HTTP_REQBUF_SZ,
@@ -1602,8 +1602,8 @@ clientSendMoreData(void *data, char *retbuf, ssize_t retsize)
            aclChecklistFree(ch);
        } else if (size < HTTP_REQBUF_SZ && entry->store_status == STORE_PENDING) {
            /* wait for more to arrive */
-            http->reqofs += retsize;
-            assert(http->reqofs <= HTTP_REQBUF_SZ);
+           http->reqofs += retsize;
+           assert(http->reqofs <= HTTP_REQBUF_SZ);
            storeClientCopy(http->sc, entry,
                http->out.offset + http->reqofs,
                HTTP_REQBUF_SZ - http->reqofs,
@@ -1613,12 +1613,12 @@ clientSendMoreData(void *data, char *retbuf, ssize_t retsize)
            return;
        }
     } else {
-       /* Avoid copying to MemBuf if we know "rep" is NULL, and we only have a body */
-       http->out.offset += body_size;
-        assert(rep == NULL);
-       comm_write(fd, buf, size, clientWriteBodyComplete, http, NULL);
-       /* NULL because clientWriteBodyComplete frees it */
-       return;
+       /* Avoid copying to MemBuf if we know "rep" is NULL, and we only have a body */
+       http->out.offset += body_size;
+       assert(rep == NULL);
+       comm_write(fd, buf, size, clientWriteBodyComplete, http, NULL);
+       /* NULL because clientWriteBodyComplete frees it */
+       return;
     }
     if (http->request->method == METHOD_HEAD) {
        if (rep) {
@@ -1720,7 +1720,7 @@ clientKeepaliveNextRequest(clientHttpRequest * http)
        if (0 == storeClientCopyPending(http->sc, entry, http)) {
            if (EBIT_TEST(entry->flags, ENTRY_ABORTED))
                debug(33, 0) ("clientKeepaliveNextRequest: ENTRY_ABORTED\n");
-            http->reqofs = 0;
+           http->reqofs = 0;
            storeClientCopy(http->sc, entry,
                http->out.offset,
                HTTP_REQBUF_SZ,
@@ -1779,7 +1779,7 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da
         * storage manager. */
        if (EBIT_TEST(entry->flags, ENTRY_ABORTED))
            debug(33, 0) ("clientWriteComplete 2: ENTRY_ABORTED\n");
-        http->reqofs = 0;
+       http->reqofs = 0;
        storeClientCopy(http->sc, entry,
            http->out.offset,
            HTTP_REQBUF_SZ,
@@ -1878,8 +1878,8 @@ clientProcessRequest2(clientHttpRequest * http)
     }
     /* We don't cache any range requests (for now!) -- adrian */
     if (r->flags.range) {
-        http->entry = NULL;
-        return LOG_TCP_MISS;
+       http->entry = NULL;
+       return LOG_TCP_MISS;
     }
     debug(33, 3) ("clientProcessRequest2: default HIT\n");
     http->entry = e;
@@ -1936,8 +1936,8 @@ clientProcessRequest(clientHttpRequest * http)
 #if DELAY_POOLS
        delaySetStoreClient(http->sc, delayClient(r));
 #endif
-        assert(http->log_type == LOG_TCP_HIT);
-        http->reqofs = 0;
+       assert(http->log_type == LOG_TCP_HIT);
+       http->reqofs = 0;
        storeClientCopy(http->sc, http->entry,
            http->out.offset,
            HTTP_REQBUF_SZ,
index 7c17bd519ad67c90c16aaadbd7a4d7400879c775..31fbe9e3b67812415145c58a0baee874a7c9a575 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.326 2002/02/26 02:30:50 adrian Exp $
+ * $Id: comm.cc,v 1.327 2002/04/01 05:59:50 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -986,33 +986,32 @@ checkTimeouts(void)
     fde *F = NULL;
     PF *callback;
     for (fd = 0; fd <= Biggest_FD; fd++) {
-        F = &fd_table[fd];
-        if (!F->flags.open)
-            continue;
-        if (F->timeout == 0)
-            continue;
-        if (F->timeout > squid_curtime)
-            continue;
-        debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd);
-        if (F->timeout_handler) {
-            debug(5, 5) ("checkTimeouts: FD %d: Call timeout handler\n", fd);
-            callback = F->timeout_handler;
-            F->timeout_handler = NULL;
-            callback(fd, F->timeout_data);
-        } else {
-            debug(5, 5) ("checkTimeouts: FD %d: Forcing comm_close()\n", fd);
-            comm_close(fd);
-        }
-    }
-}
-
-
-int 
+       F = &fd_table[fd];
+       if (!F->flags.open)
+           continue;
+       if (F->timeout == 0)
+           continue;
+       if (F->timeout > squid_curtime)
+           continue;
+       debug(5, 5) ("checkTimeouts: FD %d Expired\n", fd);
+       if (F->timeout_handler) {
+           debug(5, 5) ("checkTimeouts: FD %d: Call timeout handler\n", fd);
+           callback = F->timeout_handler;
+           F->timeout_handler = NULL;
+           callback(fd, F->timeout_data);
+       } else {
+           debug(5, 5) ("checkTimeouts: FD %d: Forcing comm_close()\n", fd);
+           comm_close(fd);
+       }
+    }
+}
+
+
+int
 commDeferRead(int fd)
 {
     fde *F = &fd_table[fd];
     if (F->defer_check == NULL)
-        return 0;
+       return 0;
     return F->defer_check(fd, F->defer_data);
 }
-
index 6dfddaecc8c01feec019684beddfdac47b9dfeb6..3ee2c37968f900eaacb36e11b791add6447e9b1e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.428 2002/02/26 15:48:15 adrian Exp $
+ * $Id: protos.h,v 1.429 2002/04/01 05:59:50 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1048,7 +1048,7 @@ extern store_client *storeClientListSearch(const MemObject * mem, void *data);
 #endif
 extern store_client *storeClientListAdd(StoreEntry * e, void *data);
 extern void storeClientCopyOld(store_client *, StoreEntry *, off_t, off_t, size_t, char *, STCB *, void *);
-extern void storeClientCopy(store_client *, StoreEntry * , off_t, size_t, char *, STCB *, void *);
+extern void storeClientCopy(store_client *, StoreEntry *, off_t, size_t, char *, STCB *, void *);
 extern int storeClientCopyPending(store_client *, StoreEntry * e, void *data);
 extern int storeUnregister(store_client * sc, StoreEntry * e, void *data);
 extern off_t storeLowestMemReaderOffset(const StoreEntry * entry);
index 753c56d9f77afcbb1265fa34660d970553ef8fc6..396e886feb88501ad4cb4f1d09ac91019111da67 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.410 2002/02/26 15:48:16 adrian Exp $
+ * $Id: structs.h,v 1.411 2002/04/01 05:59:50 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1078,8 +1078,8 @@ struct _clientHttpRequest {
        char *location;
     } redirect;
     dlink_node active;
-    char norm_reqbuf[HTTP_REQBUF_SZ]; /* For 'normal requests' */
-    char ims_reqbuf[HTTP_REQBUF_SZ];  /* For 'ims' requests */
+    char norm_reqbuf[HTTP_REQBUF_SZ];  /* For 'normal requests' */
+    char ims_reqbuf[HTTP_REQBUF_SZ];   /* For 'ims' requests */
     char *reqbuf;
     int reqofs;
     int reqsize;