Changes to squid-1.1.alpha2:
- Added Support for RFC931/ident
+ - Added Asynchronous Disk I/O routines from Pete Bentley.
Changes to squid-1.0.1 (July 8, 1996):
-# From configure.in Revision: 1.18.2.31
+# From configure.in Revision: 1.21
ac_aux_dir=
for ac_dir in aux $srcdir/aux; do
if test -f $ac_dir/install-sh; then
for ac_hdr in \
alloca.h \
+ aio.h \
arpa/inet.h \
arpa/nameser.h \
bstring.h \
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1334 "configure"
+#line 1335 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 1365 "configure"
+#line 1366 "configure"
#include "confdefs.h"
#include <time.h>
#include <sys/time.h>
echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 1391 "configure"
+#line 1392 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <malloc.h>
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1423 "configure"
+#line 1424 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1457 "configure"
+#line 1458 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
+#line 1492 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1523 "configure"
+#line 1524 "configure"
#include "confdefs.h"
#ifdef __GNUC__
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1582 "configure"
+#line 1583 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1611 "configure"
+#line 1612 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1665 "configure"
+#line 1666 "configure"
#include "confdefs.h"
find_stack_direction ()
{
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1710 "configure"
+#line 1711 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1750 "configure"
+#line 1751 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lmalloc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1790 "configure"
+#line 1791 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1824 "configure"
+#line 1825 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lbsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1864 "configure"
+#line 1865 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-l44bsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1905 "configure"
+#line 1906 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1939 "configure"
+#line 1940 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 1975 "configure"
#include "confdefs.h"
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2052 "configure"
+#line 2053 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
SQUID_FD_SETSIZE=256
else
cat > conftest.$ac_ext <<EOF
-#line 2102 "configure"
+#line 2103 "configure"
#include "confdefs.h"
#include <unistd.h>
SQUID_UDP_SO_SNDBUF=8192
else
cat > conftest.$ac_ext <<EOF
-#line 2170 "configure"
+#line 2171 "configure"
#include "confdefs.h"
#include <sys/types.h>
SQUID_UDP_SO_RCVBUF=8192
else
cat > conftest.$ac_ext <<EOF
-#line 2206 "configure"
+#line 2207 "configure"
#include "confdefs.h"
#include <sys/types.h>
SQUID_TCP_SO_SNDBUF=8192
else
cat > conftest.$ac_ext <<EOF
-#line 2242 "configure"
+#line 2243 "configure"
#include "confdefs.h"
#include <sys/types.h>
SQUID_TCP_SO_RCVBUF=8192
else
cat > conftest.$ac_ext <<EOF
-#line 2278 "configure"
+#line 2279 "configure"
#include "confdefs.h"
#include <sys/types.h>
echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 2311 "configure"
+#line 2312 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() { return 0; }
dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.21 1996/07/09 03:41:04 wessels Exp $
+dnl $Id: configure.in,v 1.22 1996/07/09 04:46:47 wessels Exp $
dnl
dnl
dnl
AC_INIT(src/main.c)
AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.21 $)dnl
+AC_REVISION($Revision: 1.22 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AC_CONFIG_AUX_DIR(aux)
AC_CHECK_HEADERS( \
alloca.h \
+ aio.h \
arpa/inet.h \
arpa/nameser.h \
bstring.h \
/* Define if you have the timegm function. */
#undef HAVE_TIMEGM
+/* Define if you have the <aio.h> header file. */
+#undef HAVE_AIO_H
+
/* Define if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.in,v 1.26 1996/07/09 03:41:17 wessels Exp $
+# $Id: Makefile.in,v 1.27 1996/07/09 04:46:49 wessels Exp $
#
# Uncomment and customize the following to suit your needs:
#
PROGS = squid client
UTILS = dnsserver ftpget
CGIPROGS = cachemgr.cgi
-OBJS = acl.o background.o cache_cf.o errorpage.o comm.o \
- debug.o disk.o dynamic_array.o \
+OBJS = acl.o async_io.o background.o cache_cf.o errorpage.o \
+ comm.o debug.o disk.o dynamic_array.o \
fdstat.o filemap.o ftp.o gopher.o \
hash.o http.o icp.o ident.o ipcache.o \
main.o mime.o neighbors.o objcache.o \
/*
- * $Id: comm.cc,v 1.33 1996/07/09 03:41:20 wessels Exp $
+ * $Id: comm.cc,v 1.34 1996/07/09 04:46:50 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
nfds = 0;
maxfd = fdstat_biggest_fd() + 1;
for (i = 0; i < maxfd; i++) {
+#if USE_ASYNC_IO
+ /* Using async IO for disk handle, so don't select on them */
+ if (fdstat_type(i) == FD_FILE)
+ continue;
+#endif
/* Check each open socket for a handler. */
if (fd_table[i].read_handler && fd_table[i].stall_until <= squid_curtime) {
nfds++;
if (shutdown_pending || reread_pending)
debug(5, 2, "comm_select: Still waiting on %d FDs\n", nfds);
while (1) {
+#if USE_ASYNC_IO
+ /* Another CPU vs latency tradeoff for async IO */
+ poll_time.tv_sec = 0;
+ poll_time.tv_usec = 250000;
+#else
poll_time.tv_sec = sec > 1 ? 1 : 0;
poll_time.tv_usec = 0;
+#endif
num = select(maxfd, &readfds, &writefds, &exceptfds, &poll_time);
if (num >= 0)
break;
return COMM_ERROR;
/* NOTREACHED */
}
+#if USE_ASYNC_IO
+ aioExamine(); /* See if any IO completed */
+#endif
if (num < 0)
continue;
debug(5, num ? 5 : 8, "comm_select: %d sockets ready at %d\n",
/*
- * $Id: disk.cc,v 1.13 1996/07/09 03:41:22 wessels Exp $
+ * $Id: disk.cc,v 1.14 1996/07/09 04:46:51 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
#include "squid.h"
#define DISK_LINE_LEN 1024
-#define MAX_FILE_NAME_LEN 256
-
-typedef struct _dread_ctrl {
- int fd;
- off_t offset;
- int req_len;
- char *buf;
- int cur_len;
- int end_of_file;
- int (*handler) _PARAMS((int fd, char *buf, int size, int errflag, void *data,
- int offset));
- void *client_data;
-} dread_ctrl;
typedef struct _dwalk_ctrl {
int fd;
void *line_data;
} dwalk_ctrl;
-typedef struct _dwrite_q {
- char *buf;
- int len;
- int cur_offset;
- struct _dwrite_q *next;
-} dwrite_q;
-
-typedef struct _FileEntry {
- char filename[MAX_FILE_NAME_LEN];
- enum {
- NO, YES
- } at_eof;
- enum {
- NOT_OPEN, OPEN
- } open_stat;
- enum {
- NOT_REQUEST, REQUEST
- } close_request;
- enum {
- NOT_PRESENT, PRESENT
- } write_daemon;
- enum {
- UNLOCK, LOCK
- } write_lock;
- int access_code; /* use to verify write lock */
- enum {
- NO_WRT_PENDING, WRT_PENDING
- } write_pending;
- void (*wrt_handle) ();
- void *wrt_handle_data;
- dwrite_q *write_q;
- dwrite_q *write_q_tail;
-} FileEntry;
-
/* table for FILE variable, write lock and queue. Indexed by fd. */
FileEntry *file_table;
file_table[fd].write_q_tail = wq;
}
- if (file_table[fd].write_daemon == NOT_PRESENT) {
- /* got to start write routine for this fd */
- comm_set_select_handler(fd, COMM_SELECT_WRITE, (PF) diskHandleWrite,
- (void *) &file_table[fd]);
- }
+ if (file_table[fd].write_daemon == PRESENT)
+ return DISK_OK;
+ /* got to start write routine for this fd */
+#if USE_ASYNC_IO
+ return aioFileQueueWrite(fd,
+ file_aio_write_complete,
+ &file_table[fd]);
+#else
+ comm_set_select_handler(fd,
+ COMM_SELECT_WRITE,
+ (PF) diskHandleWrite,
+ (void *) &file_table[fd]);
return DISK_OK;
+#endif
}
ctrl_dat->handler = handler;
ctrl_dat->client_data = client_data;
+#if USE_ASYNC_IO
+ return aioFileQueueRead(fd, file_aio_read_complete, ctrl_dat);
+#else
comm_set_select_handler(fd,
COMM_SELECT_READ,
(PF) diskHandleRead,
(void *) ctrl_dat);
-
return DISK_OK;
+#endif
}
/*
- * $Id: main.cc,v 1.47 1996/07/09 03:41:32 wessels Exp $
+ * $Id: main.cc,v 1.48 1996/07/09 04:46:52 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
}
squid_signal(SIGPIPE, SIG_IGN, SA_RESTART);
squid_signal(SIGCHLD, sig_child, SA_NODEFER | SA_RESTART);
+#if USE_ASYNC_IO
+ squid_signal(SIGIO, aioSigHandler, SA_RESTART);
+#endif
if (ConfigFile == NULL)
ConfigFile = xstrdup(DefaultConfigFile);
/*
- * $Id: squid.h,v 1.23 1996/07/09 03:41:39 wessels Exp $
+ * $Id: squid.h,v 1.24 1996/07/09 04:46:52 wessels Exp $
*
* AUTHOR: Duane Wessels
*
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
+#if USE_ASYNC_IO && HAVE_AIO_H
+#include <aio.h>
+#endif
#if defined(__STRICT_ANSI__)
#include <stdarg.h>