Purpose: Makes the RETR_STAT operation in timehash a little bit more efficient. Reasoning: I stumbled on a large number of open-close sequences when trying to find the performance problem with XOVER. It turned out that this wasn't the reason (the culprit seems to be history lookups) but I left the patch in, since it is simple and clean. Patch against: snapshot 19980623, also tested on snapshot 19980719 --- inn-980623/storage/timehash/timehash.c.orig Thu Jun 18 19:13:10 1998 +++ inn-980623/storage/timehash/timehash.c Mon Jul 13 09:55:41 1998 @@ -176,6 +176,19 @@ struct stat sb; ARTHANDLE *art; + if (amount == RETR_STAT) { + if (access(path, R_OK) < 0) { + SMseterror(SMERR_UNDEFINED, NULL); + return NULL; + } + art = NEW(ARTHANDLE, 1); + art->type = TOKEN_TIMEHASH; + art->data = NULL; + art->len = 0; + art->private = NULL; + return art; + } + if ((fd = open(path, O_RDONLY)) < 0) { SMseterror(SMERR_UNDEFINED, NULL); return NULL; @@ -183,14 +196,6 @@ art = NEW(ARTHANDLE, 1); art->type = TOKEN_TIMEHASH; - - if (amount == RETR_STAT) { - art->data = NULL; - art->len = 0; - art->private = NULL; - close(fd); - return art; - } if (fstat(fd, &sb) < 0) { SMseterror(SMERR_UNDEFINED, NULL);