[evolution-data-server] Bug 730979 - [IMAPx] Quota information is not read properly



commit 1a10781b5bfdab3817d4ae90afc541664349c546
Author: Milan Crha <mcrha redhat com>
Date:   Fri May 30 19:15:42 2014 +0200

    Bug 730979 - [IMAPx] Quota information is not read properly
    
    This is regression after a fix for bug #722275.

 camel/providers/imapx/camel-imapx-input-stream.c |   92 +++++++++++----------
 1 files changed, 48 insertions(+), 44 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-input-stream.c 
b/camel/providers/imapx/camel-imapx-input-stream.c
index ccc1542..1f1b30e 100644
--- a/camel/providers/imapx/camel-imapx-input-stream.c
+++ b/camel/providers/imapx/camel-imapx-input-stream.c
@@ -368,54 +368,58 @@ camel_imapx_input_stream_astring (CamelIMAPXInputStream *is,
        p = is->priv->ptr;
        e = is->priv->end;
 
-       /* skip whitespace/prefill buffer */
-       do {
-               while (p >= e ) {
-                       is->priv->ptr = p;
-                       if (imapx_input_stream_fill (is, cancellable, error) == IMAPX_TOK_ERROR)
-                               return FALSE;
-                       p = is->priv->ptr;
-                       e = is->priv->end;
-               }
-               c = *p++;
-       } while (c == ' ' || c == '\r');
-
-       if (c == '\"' || c == '{') {
+       if (is->priv->unget) {
                tok = camel_imapx_input_stream_token (is, data, &len, cancellable, error);
        } else {
-               guchar *o, *oe;
-
-               tok = IMAPX_TOK_STRING;
-
-               /* <any %x01-7F except "(){ " / %x00-1F / %x7F > */
-               o = is->priv->tokenbuf;
-               oe = is->priv->tokenbuf + is->priv->bufsize - 1;
-               *o++ = c;
-               while (1) {
-                       while (p < e) {
-                               c = *p++;
-                               if (c <= 0x1f || c == 0x7f || c == '(' || c == ')' || c == '{' || c == ' ') {
-                                       if (c == ' ' || c == '\r')
-                                               is->priv->ptr = p;
-                                       else
-                                               is->priv->ptr = p - 1;
-                                       *o = 0;
-                                       *data = is->priv->tokenbuf;
-                                       return TRUE;
-                               }
+               /* skip whitespace/prefill buffer */
+               do {
+                       while (p >= e ) {
+                               is->priv->ptr = p;
+                               if (imapx_input_stream_fill (is, cancellable, error) == IMAPX_TOK_ERROR)
+                                       return FALSE;
+                               p = is->priv->ptr;
+                               e = is->priv->end;
+                       }
+                       c = *p++;
+               } while (c == ' ' || c == '\r');
+
+               if (c == '\"' || c == '{') {
+                       tok = camel_imapx_input_stream_token (is, data, &len, cancellable, error);
+               } else {
+                       guchar *o, *oe;
+
+                       tok = IMAPX_TOK_STRING;
+
+                       /* <any %x01-7F except "(){ " / %x00-1F / %x7F > */
+                       o = is->priv->tokenbuf;
+                       oe = is->priv->tokenbuf + is->priv->bufsize - 1;
+                       *o++ = c;
+                       while (1) {
+                               while (p < e) {
+                                       c = *p++;
+                                       if (c <= 0x1f || c == 0x7f || c == '(' || c == ')' || c == '{' || c 
== ' ') {
+                                               if (c == ' ' || c == '\r')
+                                                       is->priv->ptr = p;
+                                               else
+                                                       is->priv->ptr = p - 1;
+                                               *o = 0;
+                                               *data = is->priv->tokenbuf;
+                                               return TRUE;
+                                       }
 
-                               if (o >= oe) {
-                                       camel_imapx_input_stream_grow (is, 0, &p, &o);
-                                       oe = is->priv->tokenbuf + is->priv->bufsize - 1;
-                                       e = is->priv->end;
+                                       if (o >= oe) {
+                                               camel_imapx_input_stream_grow (is, 0, &p, &o);
+                                               oe = is->priv->tokenbuf + is->priv->bufsize - 1;
+                                               e = is->priv->end;
+                                       }
+                                       *o++ = c;
                                }
-                               *o++ = c;
+                               is->priv->ptr = p;
+                               if (imapx_input_stream_fill (is, cancellable, error) == IMAPX_TOK_ERROR)
+                                       return FALSE;
+                               p = is->priv->ptr;
+                               e = is->priv->end;
                        }
-                       is->priv->ptr = p;
-                       if (imapx_input_stream_fill (is, cancellable, error) == IMAPX_TOK_ERROR)
-                               return FALSE;
-                       p = is->priv->ptr;
-                       e = is->priv->end;
                }
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]