[tpop3d-discuss]mailbox->apply_changes() at connection_shutdown().
Chris Lightfoot
chris at ex-parrot.com
Fri, 30 Sep 2005 18:10:28 +0100
On Fri, Sep 30, 2005 at 06:48:55PM +0200, Jacek D?bowczyk wrote:
> Hi,
>
> probably I found bug in use of mailbox->apply_changes(). This is called only
> when when client sends QUIT command. Therefore in situation when client
> sends number of DELE and simly closes connection, these commands won't be
> applied (in my opinion they should).
um. That's a requirement of the RFC, in fact -- you only
go into the UPDATE state when a QUIT command is correctly
issued. Actually in the CVS version there's code to do
much as you describe, with an option to switch this off
(no-commit-on-early-close).
> I'm attaching patches, which repairs this bug. Additionaly I'm using
> cucipop-style logging in my system, which is placed in these patches.
ok -- I will look at adding this.
> --- netloop.c.orig Sun Jul 31 18:36:40 2005
> +++ netloop.c Sun Jul 31 18:36:40 2005
> @@ -462,8 +462,12 @@
> if (c->cstate == closed) {
> /* We should now log the closure of the connection and ending
> * of any authenticated session. */
> - if (c->a)
> + if (c->a) {
> log_print(LOG_INFO, _("connections_post_select: client %s: finished session for `%s' with %s"), c->idstr, c->a->user, c->a->auth);
> + if (c->m)
> + log_print(LOG_NOTICE, _("%s[%d] %s%s %d, %d (%d), %d (%d)"), c->a->user, c->a->uid, c->remote_ip, (c->secured ? ":SSL" : ""),
> + time(NULL) - c->start_time, c->m->numdeleted, c->m->sizedeleted, c->m->num, c->m->totalsize);
> + }
> log_print(LOG_INFO, _("connections_post_select: client %s: disconnected; %d/%d bytes read/written"), c->idstr, c->nrd, c->nwr);
>
> /* remove_connection(c);*/
--
``One thousand years ago we wouldn't have known the news outside our village.
I wish things were like that now.''
(http://themanwhofellasleep.com/gossip2.html)