diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2005-10-21 10:08:21 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2005-10-21 10:08:21 +0000 |
commit | 7c57be7e7568fd784adf044bbe1af088f726ccf4 (patch) | |
tree | ad798790fc3422da29c33880a4f85e31d2642c50 /transact.c | |
parent | 5e02700dbbd1146d4d7970b9d8555bf9694a4b72 (diff) | |
download | fetchmail-7c57be7e7568fd784adf044bbe1af088f726ccf4.tar.gz fetchmail-7c57be7e7568fd784adf044bbe1af088f726ccf4.tar.bz2 fetchmail-7c57be7e7568fd784adf044bbe1af088f726ccf4.zip |
Global variable cleanup, to fix daemon mode reinitialization problems.
Patch by Sunil Shetye.
svn path=/trunk/; revision=4362
Diffstat (limited to 'transact.c')
-rw-r--r-- | transact.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -37,17 +37,23 @@ #include "socket.h" #include "fetchmail.h" -int mytimeout; /* value of nonreponse timeout */ -int suppress_tags; /* emit tags? */ -char shroud[PASSWORDLEN*2+3]; /* string to shroud in debug output */ -struct msgblk msgblk; +/* global variables: please reinitialize them explicitly for proper + * working in daemon mode */ +/* session variables initialized in init_transact() */ +int suppress_tags = FALSE; /* emit tags? */ char tag[TAGLEN]; static int tagnum; #define GENSYM (sprintf(tag, "A%04d", ++tagnum % TAGMOD), tag) +static struct method *protocol; +char shroud[PASSWORDLEN*2+3]; /* string to shroud in debug output */ +/* session variables initialized in do_session() */ +int mytimeout; /* value of nonreponse timeout */ + +/* mail variables initialized in readheaders() */ +struct msgblk msgblk; static int accept_count, reject_count; -static struct method *protocol; static void map_name(const char *name, struct query *ctl, struct idlist **xmit_names) /* add given name to xmit_names if it matches declared localnames */ @@ -1391,9 +1397,11 @@ int readbody(int sock, struct query *ctl, flag forward, int len) void init_transact(const struct method *proto) /* initialize state for the send and receive functions */ { + suppress_tags = FALSE; tagnum = 0; tag[0] = '\0'; /* nuke any tag hanging out from previous query */ protocol = (struct method *)proto; + shroud[0] = '\0'; } static void enshroud(char *buf) |