diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2000-01-17 02:18:39 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2000-01-17 02:18:39 +0000 |
commit | f1fa3732087b628f3950c4624319257b02d4f8d7 (patch) | |
tree | c304596b462128c21510ac5000b3b9a7822c8191 /driver.c | |
parent | 91edebd962aa90b42cb75b39064dd7e4e27841f1 (diff) | |
download | fetchmail-f1fa3732087b628f3950c4624319257b02d4f8d7.tar.gz fetchmail-f1fa3732087b628f3950c4624319257b02d4f8d7.tar.bz2 fetchmail-f1fa3732087b628f3950c4624319257b02d4f8d7.zip |
drive.c now tracks stage.
svn path=/trunk/; revision=2712
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -80,6 +80,7 @@ extern char *strstr(); /* needed on sysV68 R3V7.1. */ int batchcount; /* count of messages sent in current batch */ flag peek_capable; /* can we peek for better error recovery? */ int pass; /* how many times have we re-polled? */ +int stage; /* where are we? */ int phase; /* where are we, for error-logging purposes? */ static const struct method *protocol; @@ -1664,6 +1665,7 @@ const int maxfetch; /* maximum number of messages to fetch */ goto cleanUp; /* try to get authorized to fetch mail */ + stage = STAGE_GETAUTH; if (protocol->getauth) { if (protocol->password_canonify) @@ -1737,6 +1739,7 @@ const int maxfetch; /* maximum number of messages to fetch */ } /* compute # of messages and number of new messages waiting */ + stage = STAGE_GETRANGE; ok = (protocol->getrange)(mailserver_socket, ctl, idp->id, &count, &new, &bytes); if (ok != 0) goto cleanUp; @@ -1835,6 +1838,7 @@ const int maxfetch; /* maximum number of messages to fetch */ for (i = 0; i < count; i++) msgsizes[i] = -1; + stage = STAGE_GETSIZES; ok = (proto->getsizes)(mailserver_socket, count, msgsizes); if (ok != 0) goto cleanUp; @@ -1848,6 +1852,7 @@ const int maxfetch; /* maximum number of messages to fetch */ } /* read, forward, and delete messages */ + stage = STAGE_FETCH; for (num = 1; num <= count; num++) { flag toolarge = NUM_NONZERO(ctl->limit) @@ -2188,7 +2193,10 @@ const int maxfetch; /* maximum number of messages to fetch */ cleanUp: /* we only get here on error */ if (ok != 0 && ok != PS_SOCKET) + { + stage = STAGE_LOGOUT; (protocol->logout_cmd)(mailserver_socket, ctl); + } SockClose(mailserver_socket); } |