]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl
authorwessels <>
Wed, 1 Nov 2000 10:58:51 +0000 (10:58 +0000)
committerwessels <>
Wed, 1 Nov 2000 10:58:51 +0000 (10:58 +0000)
src/client_side.cc
src/comm.cc
src/disk.cc
src/main.cc
src/stmem.cc

index 807a8749fa35dc6801dbf46ff21cb8119c22ccf5..20dc61834b8d0f465b3933bce8f0b2307a612a46 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.508 2000/10/20 23:50:59 hno Exp $
+ * $Id: client_side.cc,v 1.509 2000/11/01 03:58:51 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1825,14 +1825,14 @@ clientKeepaliveNextRequest(clientHttpRequest * http)
         * Set the timeout BEFORE calling clientReadRequest().
         */
        commSetTimeout(conn->fd, Config.Timeout.pconn, requestTimeout, conn);
-        /*
-         * CYGWIN has a problem and is blocking on read() requests when there
-         * is no data present.
-         * This hack may hit performance a little, but it's better than 
-         * blocking!.
-         */
+       /*
+        * CYGWIN has a problem and is blocking on read() requests when there
+        * is no data present.
+        * This hack may hit performance a little, but it's better than 
+        * blocking!.
+        */
 #ifdef _SQUID_CYGWIN_
-        commSetSelect(conn->fd, COMM_SELECT_READ, clientReadRequest, conn, 0);
+       commSetSelect(conn->fd, COMM_SELECT_READ, clientReadRequest, conn, 0);
 #else
        clientReadRequest(conn->fd, conn);      /* Read next request */
 #endif
index 3ff2e3cc72cb9c2c42e43c6e72a69e4fa3ae8b1b..5d13f92a77380c6bd19bb929038e49d46c945453 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.311 2000/10/20 23:51:00 hno Exp $
+ * $Id: comm.cc,v 1.312 2000/11/01 03:58:51 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -534,7 +534,7 @@ commCallCloseHandlers(int fd)
        if (cbdataValid(ch->data))
            ch->handler(fd, ch->data);
        cbdataUnlock(ch->data);
-       memPoolFree(conn_close_pool, ch);       // AAA
+       memPoolFree(conn_close_pool, ch);       /* AAA */
     }
 }
 
@@ -654,7 +654,7 @@ commSetSelect(int fd, unsigned int type, PF * handler, void *client_data, time_t
 void
 comm_add_close_handler(int fd, PF * handler, void *data)
 {
-    close_handler *new = memPoolAlloc(conn_close_pool);        // AAA
+    close_handler *new = memPoolAlloc(conn_close_pool);                /* AAA */
     close_handler *c;
     debug(5, 5) ("comm_add_close_handler: FD %d, handler=%p, data=%p\n",
        fd, handler, data);
@@ -685,7 +685,8 @@ comm_remove_close_handler(int fd, PF * handler, void *data)
     else
        fd_table[fd].close_handler = p->next;
     cbdataUnlock(p->data);
-    memPoolFree(conn_close_pool,p);    // AAA
+    memPoolFree(conn_close_pool, p);   /* AAA */
+
 }
 
 static void
@@ -720,27 +721,26 @@ commSetNonBlocking(int fd)
 {
     int flags;
     int dummy = 0;
-#ifdef _SQUID_CYGWIN_ 
+#ifdef _SQUID_CYGWIN_
     int nonblocking = TRUE;
-    if(fd_table[fd].type != FD_PIPE) {
-        if(ioctl(fd, FIONBIO, &nonblocking) < 0) {
-            debug(50, 0) ("commSetNonBlocking: FD %d: %s %D\n", fd, xstrerror(), fd_table[fd].type);
-            return COMM_ERROR;
-        }
-    }
-    else {
-#endif 
-    if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
-       debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
-       return COMM_ERROR;
-    }
-    if (fcntl(fd, F_SETFL, flags | SQUID_NONBLOCK) < 0) {
-       debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, xstrerror());
-       return COMM_ERROR;
+    if (fd_table[fd].type != FD_PIPE) {
+       if (ioctl(fd, FIONBIO, &nonblocking) < 0) {
+           debug(50, 0) ("commSetNonBlocking: FD %d: %s %D\n", fd, xstrerror(), fd_table[fd].type);
+           return COMM_ERROR;
+       }
+    } else {
+#endif
+       if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
+           debug(50, 0) ("FD %d: fcntl F_GETFL: %s\n", fd, xstrerror());
+           return COMM_ERROR;
+       }
+       if (fcntl(fd, F_SETFL, flags | SQUID_NONBLOCK) < 0) {
+           debug(50, 0) ("commSetNonBlocking: FD %d: %s\n", fd, xstrerror());
+           return COMM_ERROR;
+       }
+#ifdef _SQUID_CYGWIN_
     }
-#ifdef _SQUID_CYGWIN_ 
-   } 
-#endif 
+#endif
     fd_table[fd].flags.nonblocking = 1;
     return 0;
 }
index 6724383bd7b2275d47d3aa483d66720bc05f60f5..6abedd4b83c0463e58150ddfe8f4851b8c34579a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: disk.cc,v 1.152 2000/10/20 23:51:00 hno Exp $
+ * $Id: disk.cc,v 1.153 2000/11/01 03:58:52 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -160,7 +160,10 @@ diskCombineWrites(struct _fde_disk *fdd)
            fdd->write_q = q->next;
            if (q->free_func)
                (q->free_func) (q->buf);
-           if (q) { memFree(q, MEM_DWRITE_Q); q = NULL; }
+           if (q) {
+               memFree(q, MEM_DWRITE_Q);
+               q = NULL;
+           }
        } while (fdd->write_q != NULL);
        fdd->write_q_tail = wq;
        fdd->write_q = wq;
@@ -224,7 +227,10 @@ diskHandleWrite(int fd, void *notused)
                fdd->write_q = q->next;
                if (q->free_func)
                    (q->free_func) (q->buf);
-               if (q) { memFree(q, MEM_DWRITE_Q); q = NULL; }
+               if (q) {
+                   memFree(q, MEM_DWRITE_Q);
+                   q = NULL;
+               }
            } while ((q = fdd->write_q));
        }
        len = 0;
@@ -241,7 +247,10 @@ diskHandleWrite(int fd, void *notused)
            fdd->write_q = q->next;
            if (q->free_func)
                (q->free_func) (q->buf);
-           if (q) { memFree(q, MEM_DWRITE_Q); q = NULL; }
+           if (q) {
+               memFree(q, MEM_DWRITE_Q);
+               q = NULL;
+           }
        }
     }
     if (fdd->write_q == NULL) {
index ab0454c15cf7d2db403417d4c61bab91f217c7db..df76c949284f50ef28026dfed3ed72dd85f92d7f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.319 2000/10/20 23:51:00 hno Exp $
+ * $Id: main.cc,v 1.320 2000/11/01 03:58:52 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -848,8 +848,11 @@ watch_child(char *argv[])
 #endif
 
 
-/* RBCOLLINS - if cygwin stackdumps when squid is run without -N, check the cygwin1.dll version, it needs to be AT LEAST 1.1.3. execvp had a bit overflow error in a loop.. 
-*/
+    /*
+     * RBCOLLINS - if cygwin stackdumps when squid is run without
+     * -N, check the cygwin1.dll version, it needs to be AT LEAST
+     * 1.1.3.  execvp had a bit overflow error in a loop..
+     */
     /* Connect stdio to /dev/null in daemon mode */
     nullfd = open("/dev/null", O_RDWR);
     dup2(nullfd, 0);
index 4cff6930a255de90daae26ba0e24f7d8692a4f91..965dbf4e2f015a2d507c7eb460c0420458f444e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stmem.cc,v 1.66 2000/10/17 08:06:04 adrian Exp $
+ * $Id: stmem.cc,v 1.67 2000/11/01 03:58:52 wessels Exp $
  *
  * DEBUG: section 19    Store Memory Primitives
  * AUTHOR: Harvest Derived
@@ -43,7 +43,10 @@ stmemFree(mem_hdr * mem)
        mem->head = p->next;
        memFree(p->data, MEM_STMEM_BUF);
        store_mem_size -= SM_PAGE_SIZE;
-       if (p) { memFree(p, MEM_MEM_NODE); p = NULL; }
+       if (p) {
+           memFree(p, MEM_MEM_NODE);
+           p = NULL;
+       }
     }
     mem->head = mem->tail = NULL;
     mem->origin_offset = 0;
@@ -67,7 +70,10 @@ stmemFreeDataUpto(mem_hdr * mem, int target_offset)
            current_offset += lastp->len;
            memFree(lastp->data, MEM_STMEM_BUF);
            store_mem_size -= SM_PAGE_SIZE;
-           if (lastp) { memFree(lastp, MEM_MEM_NODE); lastp = NULL; }
+           if (lastp) {
+               memFree(lastp, MEM_MEM_NODE);
+               lastp = NULL;
+           }
        }
     }
     mem->head = p;