--------------------- PatchSet 3931 Date: 2002/04/07 13:10:24 Author: serassio Branch: nt-2_5 Tag: (none) Log: First WIN32 Async I/O with Robert's AWIN32 fs module Members: port/win32/include/autoconf.h:1.1.2.4->1.1.2.5 port/win32/squid/squid.dsp:1.1.2.4->1.1.2.5 src/disk.c:1.8.22.1->1.8.22.2 src/fs/awin32/store_asyncufs.h:1.1.62.1->1.1.62.2 src/fs/awin32/store_dir_aufs.c:1.1.62.3->1.1.62.4 src/fs/awin32/store_io_aufs.c:1.1.62.1->1.1.62.2 Index: squid/port/win32/include/autoconf.h =================================================================== RCS file: /cvsroot/squid-sf//squid/port/win32/include/Attic/autoconf.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/port/win32/include/autoconf.h 4 Apr 2002 19:40:21 -0000 1.1.2.4 +++ squid/port/win32/include/autoconf.h 7 Apr 2002 13:10:24 -0000 1.1.2.5 @@ -22,7 +22,7 @@ * */ -/* $Id: autoconf.h,v 1.1.2.4 2002/04/04 19:40:21 serassio Exp $ */ +/* $Id: autoconf.h,v 1.1.2.5 2002/04/07 13:10:24 serassio Exp $ */ /* * configure command line used to configure Squid @@ -88,14 +88,14 @@ * Traffic management via "delay pools". */ #undef DELAY_POOLS - +#define DELAY_POOLS 1 /* * If you want to log User-Agent request header values, define this. * By default, they are written to useragent.log in the Squid log * directory. */ #undef USE_USERAGENT_LOG -// #define USE_USERAGENT_LOG 1 +#define USE_USERAGENT_LOG 1 /* * If you want to log Referer request header values, define this. @@ -140,7 +140,7 @@ * Define this to include code for the Hypertext Cache Protocol (HTCP) */ #undef USE_HTCP -// #define USE_HTCP 1 +#define USE_HTCP 1 /* * Use Cache Digests for locating objects in neighbor caches. This Index: squid/port/win32/squid/squid.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/port/win32/squid/Attic/squid.dsp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/port/win32/squid/squid.dsp 27 Mar 2002 21:01:14 -0000 1.1.2.4 +++ squid/port/win32/squid/squid.dsp 7 Apr 2002 13:10:25 -0000 1.1.2.5 @@ -211,6 +211,10 @@ # End Source File # Begin Source File +SOURCE=..\..\..\src\htcp.c +# End Source File +# Begin Source File + SOURCE=..\..\..\src\http.c # End Source File # Begin Source File Index: squid/src/disk.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/disk.c,v retrieving revision 1.8.22.1 retrieving revision 1.8.22.2 diff -u -r1.8.22.1 -r1.8.22.2 --- squid/src/disk.c 14 Mar 2002 20:23:43 -0000 1.8.22.1 +++ squid/src/disk.c 7 Apr 2002 13:10:25 -0000 1.8.22.2 @@ -1,6 +1,6 @@ /* - * $Id: disk.c,v 1.8.22.1 2002/03/14 20:23:43 serassio Exp $ + * $Id: disk.c,v 1.8.22.2 2002/04/07 13:10:25 serassio Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -77,7 +77,7 @@ } else strcpy(fmode,"rb"); - fbuf=fopen(path,fmode); + fbuf = fopen(path,fmode); fd = (fbuf != NULL) ? fileno(fbuf) : -1; #else mode |= SQUID_NONBLOCK; Index: squid/src/fs/awin32/store_asyncufs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/awin32/Attic/store_asyncufs.h,v retrieving revision 1.1.62.1 retrieving revision 1.1.62.2 diff -u -r1.1.62.1 -r1.1.62.2 --- squid/src/fs/awin32/store_asyncufs.h 14 Mar 2002 20:23:47 -0000 1.1.62.1 +++ squid/src/fs/awin32/store_asyncufs.h 7 Apr 2002 13:10:25 -0000 1.1.62.2 @@ -20,9 +20,9 @@ /* Which operations to run async */ #define ASYNC_OPEN 1 -#define ASYNC_CLOSE 0 +#define ASYNC_CLOSE 1 #define ASYNC_CREATE 1 -#define ASYNC_WRITE 0 +#define ASYNC_WRITE 1 #define ASYNC_READ 1 struct _squidaio_result_t { Index: squid/src/fs/awin32/store_dir_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/awin32/Attic/store_dir_aufs.c,v retrieving revision 1.1.62.3 retrieving revision 1.1.62.4 diff -u -r1.1.62.3 -r1.1.62.4 --- squid/src/fs/awin32/store_dir_aufs.c 7 Apr 2002 09:59:53 -0000 1.1.62.3 +++ squid/src/fs/awin32/store_dir_aufs.c 7 Apr 2002 13:10:25 -0000 1.1.62.4 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.c,v 1.1.62.3 2002/04/07 09:59:53 serassio Exp $ + * $Id: store_dir_aufs.c,v 1.1.62.4 2002/04/07 13:10:25 serassio Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -720,9 +720,6 @@ snprintf(rb->fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X", rb->sd->path, rb->curlvl1, rb->curlvl2); - if (rb->flags.init && rb->td != NULL) - closedir(rb->td); - rb->td = NULL; if (dirs_opened) return -1; rb->td = opendir(rb->fullpath); @@ -765,6 +762,9 @@ store_open_disk_fd++; continue; } + if (rb->td != NULL) + closedir(rb->td); + rb->td = NULL; rb->in_dir = 0; if (++rb->curlvl2 < aioinfo->l2) continue; @@ -1511,8 +1511,8 @@ static struct cache_dir_option options[] = { #if NOT_YET_DONE - {"L1", storeAufsDirParseL1}, - {"L2", storeAufsDirParseL2}, + {"L1", storeAufsDirParseL1, storeAufsDirDumpL1}, + {"L2", storeAufsDirParseL2, storeAufsDirDumpL2}, #endif {NULL, NULL} }; Index: squid/src/fs/awin32/store_io_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/awin32/Attic/store_io_aufs.c,v retrieving revision 1.1.62.1 retrieving revision 1.1.62.2 diff -u -r1.1.62.1 -r1.1.62.2 --- squid/src/fs/awin32/store_io_aufs.c 14 Mar 2002 20:23:47 -0000 1.1.62.1 +++ squid/src/fs/awin32/store_io_aufs.c 7 Apr 2002 13:10:25 -0000 1.1.62.2 @@ -49,7 +49,7 @@ #if !ASYNC_OPEN fd = file_open(path, O_RDONLY | O_BINARY); if (fd < 0) { - debug(78, 3) ("storeAufsOpen: got failude (%d)\n", errno); + debug(78, 3) ("storeAufsOpen: got failure (%d)\n", errno); return NULL; } #endif @@ -182,7 +182,7 @@ #if ASYNC_READ aioRead(aiostate->fd, offset, buf, size, storeAufsReadDone, sio); #else - file_read(aiostate->fd, offset, buf, size, storeAufsReadDone, sio); + file_read(aiostate->fd, buf, size, offset, storeAufsReadDone, sio); #endif } @@ -300,7 +300,7 @@ storeAufsReadDone(int fd, void *my_data, int len, int errflag) #else static void -storeAufsReadDone(int fd, int errflag, size_t len, void *my_data) +storeAufsReadDone(int fd, const char *buf, int len, int errflag, void *my_data) #endif { storeIOState *sio = my_data; @@ -359,7 +359,7 @@ /* Translate from errno to Squid disk error */ errno = errflag; if (errflag) - errflag = errno == ENOSP ? DISK_NO_SPACE_LEFT : DISK_ERROR; + errflag = errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR; else errflag = DISK_OK; #endif