Problem with Archie client (and fix)

Avery Pennarun (apenwarr@foxnet.net)
Tue, 1 Aug 1995 13:56:44 -0400 (EDT)


The following patch gets rid of annoying "Timed out (dirsend)" errors in the
c-archie-1.4.1 client. The original sources are available from
ftp.bunyip.com.

The error only seems to show up in Linux, because, according to the
select(2) man page, Linux is unique in the way it modifies the "timeout"
variable passed to select. Is there any kind of standard for this?

Basically, archie is timing out, and then choosing a new timeout value by
multiplying the value in "timeout" by two. On most systems, this value will
be the old timeout value; on Linux, after select() times out this value is
0, and so all subsequent retries will last for 0 seconds.

This patch makes archie work much better for me, by not relying on the value
left in timeout. Increasing the initial CLIENT_DIRSRV_TIMEOUT value in
pfs.h will also help avoid timeouts in the first place.

I'm also forwarding the patch to the author.

Have fun.

Avery

diff --unified archie-1.4.1/dirsend.c archie-1.4.1+ave/dirsend.c
--- archie-1.4.1/dirsend.c Tue Oct 20 19:56:53 1992
+++ archie-1.4.1+ave/dirsend.c Tue Aug 1 13:38:18 1995
@@ -604,7 +604,8 @@
}

if (retries-- > 0) {
- timeout.tv_sec = CLIENT_DIRSRV_BACKOFF(timeout.tv_sec);
+ timeout.tv_sec = client_dirsrv_timeout = CLIENT_DIRSRV_BACKOFF(
+ client_dirsrv_timeout);
#ifdef DEBUG
if (pfs_debug > 2) {
fprintf(stderr,"Timed out. Setting timeout to %d seconds.\n",