From: wessels <> Date: Fri, 14 Nov 1997 11:55:05 +0000 (+0000) Subject: David Luyer's fixes X-Git-Tag: SQUID_3_0_PRE1~4537 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edd2eb63102a945857a4f93180c7822ec128e174;p=thirdparty%2Fsquid.git David Luyer's fixes - poll() for Linux - SHA optimizations - errno clashes - storeDirCloseSwapLogs(); logs might not be open. --- diff --git a/src/client_side.cc b/src/client_side.cc index c7ffc3bd2d..64f8ee3280 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.148 1997/11/13 00:17:08 wessels Exp $ + * $Id: client_side.cc,v 1.149 1997/11/14 04:55:05 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1570,6 +1570,8 @@ clientReadRequest(int fd, void *data) request->http_ver = http->http_ver; request->headers = headers; request->headers_sz = headers_sz; +if (request->http_ver < 1.0 || request->http_ver > 1.1) +debug(0,0)("Got HTTP version %f\n", http->http_ver); if (!urlCheckRequest(request)) { err = errorCon(ERR_UNSUP_REQ, HTTP_NOT_IMPLEMENTED); err->src_addr = conn->peer.sin_addr; diff --git a/src/comm.cc b/src/comm.cc index 2a52670576..6c1d0b4540 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.202 1997/11/12 00:08:46 wessels Exp $ + * $Id: comm.cc,v 1.203 1997/11/14 04:55:06 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -158,7 +158,7 @@ static int fdIsHttpOrIcp(int fd); static IPH commConnectDnsHandle; static void commConnectCallback(ConnectStateData * cs, int status); static int commDeferRead(int fd); -static int ignoreErrno(int errno); +static int ignoreErrno(int); static void commSetConnectTimeout(int fd, time_t timeout); static int commResetFD(ConnectStateData * cs); static int commRetryConnect(ConnectStateData * cs); @@ -1392,17 +1392,17 @@ comm_write(int fd, char *buf, int size, CWCB * handler, void *handler_data, FREE } static int -ignoreErrno(int errno) +ignoreErrno(int ierrno) { - if (errno == EWOULDBLOCK) + if (ierrno == EWOULDBLOCK) return 1; #if EAGAIN != EWOULDBLOCK - if (errno == EAGAIN) + if (ierrno == EAGAIN) return 1; #endif - if (errno == EALREADY) + if (ierrno == EALREADY) return 1; - if (errno == EINTR) + if (ierrno == EINTR) return 1; return 0; } diff --git a/src/disk.cc b/src/disk.cc index 05eb9c713e..905781a9ad 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.93 1997/11/12 00:10:45 wessels Exp $ + * $Id: disk.cc,v 1.94 1997/11/14 04:55:07 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -378,8 +378,8 @@ static void diskHandleRead(int fd, void *data) { dread_ctrl *ctrl_dat = data; - fde *F = &fd_table[fd]; #if !USE_ASYNC_IO + fde *F = &fd_table[fd]; int len; #endif disk_ctrl_t *ctrlp = xcalloc(1, sizeof(disk_ctrl_t)); diff --git a/src/squid.h b/src/squid.h index f040873bd5..ccf3f94596 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.134 1997/11/10 21:07:05 wessels Exp $ + * $Id: squid.h,v 1.135 1997/11/14 04:55:08 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -235,6 +235,8 @@ #endif #if PURIFY +/* disable assert() under purify */ +#define NODEBUG #define LOCAL_ARRAY(type,name,size) \ static type *local_##name=NULL; \ type *name = local_##name ? local_##name : \ diff --git a/src/store_dir.cc b/src/store_dir.cc index c48a1feb60..4a955fd614 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.37 1997/11/12 00:09:10 wessels Exp $ + * $Id: store_dir.cc,v 1.38 1997/11/14 04:55:09 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -281,6 +281,8 @@ storeDirCloseSwapLogs(void) SwapDir *SD; for (i = 0; i < Config.cacheSwap.n_configured; i++) { SD = &Config.cacheSwap.swapDirs[i]; + if (SD->swaplog_fd < 0) /* not open */ + continue; file_close(SD->swaplog_fd); debug(47, 3) ("Cache Dir #%d log closed on FD %d\n", i, SD->swaplog_fd); SD->swaplog_fd = -1;