From: wessels <> Date: Wed, 1 Nov 2000 10:58:51 +0000 (+0000) Subject: gindent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl X-Git-Tag: SQUID_3_0_PRE1~1798 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f6ffd15cbe6dc6e4c86c65f4e0374f017ad9286;p=thirdparty%2Fsquid.git gindent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl --- diff --git a/src/client_side.cc b/src/client_side.cc index 807a8749fa..20dc61834b 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 diff --git a/src/comm.cc b/src/comm.cc index 3ff2e3cc72..5d13f92a77 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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; } diff --git a/src/disk.cc b/src/disk.cc index 6724383bd7..6abedd4b83 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -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) { diff --git a/src/main.cc b/src/main.cc index ab0454c15c..df76c94928 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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); diff --git a/src/stmem.cc b/src/stmem.cc index 4cff6930a2..965dbf4e2f 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -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;