diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-04-09 04:32:38 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-04-09 04:32:38 +0200 |
commit | 1d94a18e5683d0d69aca4c8350b7914419fae6bc (patch) | |
tree | b376bbefc5cd770d1bc15f0683f2441137f4d5c0 /sys/src/cmd/upas/fs/pop3.c | |
parent | 35f6a75355ea4f52f675f9cfbb865241512a7315 (diff) |
upas/fs: fix sync condition
we used to check for mb->d->name != nil before stating, to avoid
stating pop3/imap mailboxes who don't really have a local file,
but this breaks when the md->d is reconstructed (faked) from
the index! resulting in the mailbox stop being refreshed.
the solution is to not have mb->d == nil for imap/pop mailoxes.
Diffstat (limited to 'sys/src/cmd/upas/fs/pop3.c')
-rw-r--r-- | sys/src/cmd/upas/fs/pop3.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/src/cmd/upas/fs/pop3.c b/sys/src/cmd/upas/fs/pop3.c index 65ffbfcfa..65361fb80 100644 --- a/sys/src/cmd/upas/fs/pop3.c +++ b/sys/src/cmd/upas/fs/pop3.c @@ -539,17 +539,13 @@ pop3sync(Mailbox *mb, int doplumb, int *new) pop = mb->aux; - if(err = pop3dial(pop)) { - mb->waketime = time(0) + pop->refreshtime; - return err; - } - - if((err = pop3read(pop, mb, doplumb, new)) == nil){ + if(err = pop3dial(pop)) + goto out; + if((err = pop3read(pop, mb, doplumb, new)) == nil) pop3purge(pop, mb); - mb->d->atime = mb->d->mtime = time(0); - } pop3hangup(pop); - mb->waketime = time(0) + pop->refreshtime; +out: + mb->waketime = (ulong)time(0) + pop->refreshtime; return err; } @@ -661,7 +657,6 @@ pop3mbox(Mailbox *mb, char *path) mb->sync = pop3sync; mb->close = pop3close; mb->ctl = pop3ctl; - mb->d = emalloc(sizeof *mb->d); mb->addfrom = 1; return nil; } |