aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-10-13 16:45:09 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-10-13 16:45:09 +0000
commite0ec82cf5e4e9ca3070ed5a3ff51b1ff927fe7f4 (patch)
treefd6b972516acea5c0155abaef7282a63bb36708f /driver.c
parent3fb4233b2db4486b6e593546798604bbdaf45613 (diff)
downloadfetchmail-e0ec82cf5e4e9ca3070ed5a3ff51b1ff927fe7f4.tar.gz
fetchmail-e0ec82cf5e4e9ca3070ed5a3ff51b1ff927fe7f4.tar.bz2
fetchmail-e0ec82cf5e4e9ca3070ed5a3ff51b1ff927fe7f4.zip
Add settable server-nonresponse timeout
svn path=/trunk/; revision=325
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/driver.c b/driver.c
index 9fb1e69f..45f17344 100644
--- a/driver.c
+++ b/driver.c
@@ -32,8 +32,8 @@
static struct method *protocol;
-static int alarmed; /* A flag to indicate that SIGALRM happened */
-int timeout = CLIENT_TIMEOUT;
+static int alarmed; /* a flag to indicate that SIGALRM happened */
+static int mytimeout; /* server-nonresponse timeout for current query */
char tag[TAGLEN];
static int tagnum;
@@ -476,7 +476,7 @@ struct hostrec *queryctl;
sizeticker -= SIZETICKER;
/* reset timeout so we don't choke on very long messages */
- alarm(timeout);
+ alarm(queryctl->timeout);
}
lines++;
}
@@ -581,7 +581,7 @@ struct method *proto;
alarmed = 0;
sigsave = signal(SIGALRM, alarm_handler);
- alarm (timeout);
+ alarm (mytimeout = queryctl->timeout);
#ifndef KERBEROS_V4
if (queryctl->authenticate == A_KERBEROS)
@@ -924,5 +924,6 @@ void
alarm_handler (int signal)
{
alarmed = 1;
- fprintf(stderr,"fetchmail: timeout after %d seconds.\n", timeout);
+ fprintf(stderr,
+ "fetchmail: timeout after %d seconds.\n", mytimeout);
}