/*
- * $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
* 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
/*
- * $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
if (cbdataValid(ch->data))
ch->handler(fd, ch->data);
cbdataUnlock(ch->data);
- memPoolFree(conn_close_pool, ch); // AAA
+ memPoolFree(conn_close_pool, ch); /* AAA */
}
}
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);
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
{
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;
}
/*
- * $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
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;
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;
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) {
/*
- * $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
#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);
/*
- * $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
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;
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;