commit a3b131b6e85a0323ff1f9e6213f643c84c56532a
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun May 17 17:07:54 2015 +0200

    don't make bogus attempts at enabling compression
    
    recycling server connections skips everything up to setting up the
    prefix (Path/NAMESPACE). "everything" should obviously include enabling
    compression, as that must be done at most once per connection.

 src/drv_imap.c |   64 ++++++++++++++++++++++++------------------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index dcb372d..a0c13e0 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1522,13 +1522,13 @@ static void imap_open_store_authenticate_p3( 
imap_store_t *, struct imap_cmd *,
 #endif
 static void imap_open_store_authenticate2( imap_store_t * );
 static void imap_open_store_authenticate2_p2( imap_store_t *, struct imap_cmd 
*, int );
-static void imap_open_store_namespace( imap_store_t * );
-static void imap_open_store_namespace_p2( imap_store_t *, struct imap_cmd *, 
int );
-static void imap_open_store_namespace2( imap_store_t * );
 static void imap_open_store_compress( imap_store_t * );
 #ifdef HAVE_LIBZ
 static void imap_open_store_compress_p2( imap_store_t *, struct imap_cmd *, 
int );
 #endif
+static void imap_open_store_namespace( imap_store_t * );
+static void imap_open_store_namespace_p2( imap_store_t *, struct imap_cmd *, 
int );
+static void imap_open_store_namespace2( imap_store_t * );
 static void imap_open_store_finalize( imap_store_t * );
 #ifdef HAVE_LIBSSL
 static void imap_open_store_ssl_bail( imap_store_t * );
@@ -1668,7 +1668,7 @@ imap_open_store_authenticate( imap_store_t *ctx )
                        return;
                }
 #endif
-               imap_open_store_namespace( ctx );
+               imap_open_store_compress( ctx );
        }
 }
 
@@ -2045,8 +2045,34 @@ imap_open_store_authenticate2_p2( imap_store_t *ctx, 
struct imap_cmd *cmd ATTR_U
        if (response == RESP_NO)
                imap_open_store_bail( ctx, FAIL_FINAL );
        else if (response == RESP_OK)
+               imap_open_store_compress( ctx );
+}
+
+static void
+imap_open_store_compress( imap_store_t *ctx )
+{
+#ifdef HAVE_LIBZ
+       if (CAP(COMPRESS_DEFLATE)) {
+               imap_exec( ctx, 0, imap_open_store_compress_p2, "COMPRESS 
DEFLATE" );
+               return;
+       }
+#endif
+       imap_open_store_namespace( ctx );
+}
+
+#ifdef HAVE_LIBZ
+static void
+imap_open_store_compress_p2( imap_store_t *ctx, struct imap_cmd *cmd 
ATTR_UNUSED, int response )
+{
+       if (response == RESP_NO) {
+               /* We already reported an error, but it's not fatal to us. */
+               imap_open_store_namespace( ctx );
+       } else if (response == RESP_OK) {
+               socket_start_deflate( &ctx->conn );
                imap_open_store_namespace( ctx );
+       }
 }
+#endif
 
 static void
 imap_open_store_namespace( imap_store_t *ctx )
@@ -2063,7 +2089,7 @@ imap_open_store_namespace( imap_store_t *ctx )
                        imap_open_store_namespace2( ctx );
                return;
        }
-       imap_open_store_compress( ctx );
+       imap_open_store_finalize( ctx );
 }
 
 static void
@@ -2093,39 +2119,13 @@ imap_open_store_namespace2( imap_store_t *ctx )
                        ctx->prefix = nsp_1st_ns->val;
                if (!ctx->delimiter)
                        ctx->delimiter = nfstrdup( nsp_1st_dl->val );
-               imap_open_store_compress( ctx );
+               imap_open_store_finalize( ctx );
        } else {
                imap_open_store_bail( ctx, FAIL_FINAL );
        }
 }
 
 static void
-imap_open_store_compress( imap_store_t *ctx )
-{
-#ifdef HAVE_LIBZ
-       if (CAP(COMPRESS_DEFLATE)) { /* XXX make that configurable */
-               imap_exec( ctx, 0, imap_open_store_compress_p2, "COMPRESS 
DEFLATE" );
-               return;
-       }
-#endif
-       imap_open_store_finalize( ctx );
-}
-
-#ifdef HAVE_LIBZ
-static void
-imap_open_store_compress_p2( imap_store_t *ctx, struct imap_cmd *cmd 
ATTR_UNUSED, int response )
-{
-       if (response == RESP_NO) {
-               /* We already reported an error, but it's not fatal to us. */
-               imap_open_store_finalize( ctx );
-       } else if (response == RESP_OK) {
-               socket_start_deflate( &ctx->conn );
-               imap_open_store_finalize( ctx );
-       }
-}
-#endif
-
-static void
 imap_open_store_finalize( imap_store_t *ctx )
 {
        set_bad_callback( &ctx->gen, 0, 0 );

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to