I think the errcount should be kept in struct ImapSesssion, and a clean
shutdown of the sockets and freeing of the session should follow. FATAL is
pretty darn severe...

I'm doing a cleanup of the timeout code right now, because it turns out
that lmtp, pop3 and sieved all segfault on timeouts. Bug #517.

Aaron

On Fri, Apr 27, 2007, Paul J Stevens <[EMAIL PROTECTED]> said:

>>From d10673a9dcfd66414e20bfc678b45408c926034a Mon Sep 17 00:00:00 2001
> In-Reply-To: <<[EMAIL PROTECTED]>>
> References: <<[EMAIL PROTECTED]>>
> From: Paul J Stevens <[EMAIL PROTECTED]>
> Date: Fri, 27 Apr 2007 09:20:19 +0200
> Subject: bail out after too many uncaught socket errors
> 
> ---
>  dbmail-imapsession.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/dbmail-imapsession.c b/dbmail-imapsession.c
> index 3d818a5..ee650df 100644
> --- a/dbmail-imapsession.c
> +++ b/dbmail-imapsession.c
> @@ -1308,6 +1308,7 @@ int dbmail_imap_session_printf(struct ImapSession * 
> self, char * message, ...)
>          int maxlen=100;
>          int result = 0;
>          gchar *ln;
> +     static int errcount = 0;
>  
>       assert(message);
>  
> @@ -1341,8 +1342,11 @@ int dbmail_imap_session_printf(struct ImapSession * 
> self, char * message, ...)
>               g_free(re);
>               g_free(ln);
>                  TRACE(TRACE_ERROR, "write to client socket failed");
> +             if (errcount++ > 1)
> +                     TRACE(TRACE_FATAL,"uncaught error on socket, exiting");
>               return -2;
>       }
> +     errcount = 0;
>  
>          if (result < maxlen)
>                  TRACE(TRACE_DEBUG,"RESPONSE: [%s]", re);
> -- 
> 1.5.1.1
> 
> _______________________________________________
> Dbmail-dev mailing list
> [email protected]
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
> 

-- 



_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to