From: wessels <> Date: Tue, 16 Jul 1996 05:48:27 +0000 (+0000) Subject: get ASYNC_IO stuff really working X-Git-Tag: SQUID_3_0_PRE1~6056 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94e891ea13e4fe63fcb5630334b22180c47bbd75;p=thirdparty%2Fsquid.git get ASYNC_IO stuff really working --- diff --git a/src/Makefile.in b/src/Makefile.in index 39edff3c80..4d25ae257e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,12 +1,14 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.28 1996/07/11 17:42:34 wessels Exp $ +# $Id: Makefile.in,v 1.29 1996/07/15 23:48:27 wessels Exp $ # # Uncomment and customize the following to suit your needs: # HOST_OPT = # -DCACHEMGR_HOSTNAME="getfullhostname()" -DEFINES = $(HOST_OPT) +AIO_OPT = # -DUSE_ASYNC_IO=1 +AIO_LIB = # -labi +DEFINES = $(HOST_OPT) $(AIO_OPT) prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -37,7 +39,7 @@ PERL = @PERL@ CRYPT_LIB = @CRYPT_LIB@ AC_CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ -XTRA_LIBS = @XTRA_LIBS@ +XTRA_LIBS = @XTRA_LIBS@ $(AIO_LIB) XTRA_OBJS = @XTRA_OBJS@ MV = @MV@ RM = @RM@ diff --git a/src/disk.cc b/src/disk.cc index 5e76febb3d..8395b7d375 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.17 1996/07/09 23:01:16 wessels Exp $ + * $Id: disk.cc,v 1.18 1996/07/15 23:48:32 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -436,7 +436,7 @@ int file_write(fd, ptr_to_buf, len, access_code, handle, handle_data) /* got to start write routine for this fd */ #if USE_ASYNC_IO return aioFileQueueWrite(fd, - file_aio_write_complete, + aioFileWriteComplete, &file_table[fd]); #else comm_set_select_handler(fd, @@ -532,7 +532,7 @@ int file_read(fd, buf, req_len, offset, handler, client_data) ctrl_dat->client_data = client_data; #if USE_ASYNC_IO - return aioFileQueueRead(fd, file_aio_read_complete, ctrl_dat); + return aioFileQueueRead(fd, aioFileReadComplete, ctrl_dat); #else comm_set_select_handler(fd, COMM_SELECT_READ, diff --git a/src/main.cc b/src/main.cc index 2aca9ccc12..cc216fb2e3 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.50 1996/07/14 05:35:54 wessels Exp $ + * $Id: main.cc,v 1.51 1996/07/15 23:48:34 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -390,6 +390,8 @@ static void mainInitialize() squid_signal(SIGPIPE, SIG_IGN, SA_RESTART); squid_signal(SIGCHLD, sig_child, SA_NODEFER | SA_RESTART); #if USE_ASYNC_IO + if (first_time) + aio_init(); squid_signal(SIGIO, aioSigHandler, SA_RESTART); #endif @@ -414,6 +416,7 @@ static void mainInitialize() debug(1, 1, "With %d file descriptors available\n", FD_SETSIZE); if (first_time) { + stmemInit(); /* stmem must go before at least redirect */ disk_init(); /* disk_init must go before ipcache_init() */ writePidFile(); /* write PID file */ } @@ -432,7 +435,6 @@ static void mainInitialize() urlInitialize(); stat_init(&CacheInfo, getAccessLogFile()); storeInit(); - stmemInit(); if (getEffectiveUser()) { /* we were probably started as root, so cd to a swap diff --git a/src/squid.h b/src/squid.h index 0c67f7f613..4449658ace 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.26 1996/07/11 17:42:53 wessels Exp $ + * $Id: squid.h,v 1.27 1996/07/15 23:48:36 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -230,6 +230,7 @@ typedef void (*SIH) _PARAMS((int, void *)); /* swap in */ #include "acl.h" #include "util.h" #include "background.h" +#include "async_io.h" #include "redirect.h" #if !HAVE_TEMPNAM diff --git a/src/tools.cc b/src/tools.cc index 9656af14e2..94939d5ecb 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,5 +1,6 @@ + /* - * $Id: tools.cc,v 1.43 1996/07/09 03:41:45 wessels Exp $ + * $Id: tools.cc,v 1.44 1996/07/15 23:48:38 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -527,7 +528,7 @@ void setMaxFD() time_t getCurrentTime() { -#if defined(_SQUID_MOTOROLA_) +#if GETTIMEOFDAY_NO_TZP gettimeofday(¤t_time); #else gettimeofday(¤t_time, NULL);