[evolution-data-server] Remove IMAPX_TOK_PROTOCOL.



commit 4ece2ae37a030e331d1c064b746546ed84c40415
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jul 14 07:46:13 2013 -0400

    Remove IMAPX_TOK_PROTOCOL.
    
    This just makes it awkward to check for errors.
    
    An error is an error, the GError domain should indicate the type.

 camel/camel-imapx-server.c |    3 +--
 camel/camel-imapx-stream.c |    8 ++++----
 camel/camel-imapx-stream.h |    1 -
 camel/camel-imapx-utils.c  |    4 +---
 4 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 5dea85e..65516a6 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -2200,7 +2200,7 @@ imapx_untagged_search (CamelIMAPXServer *is,
                        stream, &token, &len, cancellable, error);
                if (tok == '\n')
                        break;
-               if (tok == IMAPX_TOK_ERROR || tok == IMAPX_TOK_PROTOCOL)
+               if (tok == IMAPX_TOK_ERROR)
                        goto exit;
                camel_imapx_stream_ungettoken (stream, tok, token, len);
 
@@ -2877,7 +2877,6 @@ imapx_step (CamelIMAPXServer *is,
                stream, &token, &len, cancellable, error);
 
        switch (tok) {
-               case IMAPX_TOK_PROTOCOL:
                case IMAPX_TOK_ERROR:
                        /* GError is already set. */
                        break;
diff --git a/camel/camel-imapx-stream.c b/camel/camel-imapx-stream.c
index f547287..485c1ea 100644
--- a/camel/camel-imapx-stream.c
+++ b/camel/camel-imapx-stream.c
@@ -411,7 +411,7 @@ camel_imapx_stream_atom (CamelIMAPXStream *is,
                else
                        g_propagate_error (error, local_error);
                io (is->tagprefix, "expecting atom!\n");
-               return IMAPX_TOK_PROTOCOL;
+               return IMAPX_TOK_ERROR;
        }
 }
 
@@ -461,7 +461,7 @@ camel_imapx_stream_astring (CamelIMAPXStream *is,
                else
                        g_propagate_error (error, local_error);
                io (is->tagprefix, "expecting astring!\n");
-               return IMAPX_TOK_PROTOCOL;
+               return IMAPX_TOK_ERROR;
        }
 }
 
@@ -509,7 +509,7 @@ camel_imapx_stream_nstring (CamelIMAPXStream *is,
                        g_set_error (error, CAMEL_IMAPX_ERROR, 1, "expecting nstring");
                else
                        g_propagate_error (error, local_error);
-               return IMAPX_TOK_PROTOCOL;
+               return IMAPX_TOK_ERROR;
        case IMAPX_TOK_ERROR:
                /* we'll never get this unless there are no exception  handlers anyway */
                if (local_error != NULL)
@@ -822,7 +822,7 @@ protocol_error:
                is->priv->ptr = p;
 
        g_set_error (error, CAMEL_IMAPX_ERROR, 1, "protocol error");
-       return IMAPX_TOK_PROTOCOL;
+       return IMAPX_TOK_ERROR;
 }
 
 void
diff --git a/camel/camel-imapx-stream.h b/camel/camel-imapx-stream.h
index 9664288..42019ba 100644
--- a/camel/camel-imapx-stream.h
+++ b/camel/camel-imapx-stream.h
@@ -58,7 +58,6 @@ typedef struct _CamelIMAPXStreamClass CamelIMAPXStreamClass;
 typedef struct _CamelIMAPXStreamPrivate CamelIMAPXStreamPrivate;
 
 typedef enum {
-       IMAPX_TOK_PROTOCOL = -2,
        IMAPX_TOK_ERROR = -1,
        IMAPX_TOK_TOKEN = 256,
        IMAPX_TOK_STRING,
diff --git a/camel/camel-imapx-utils.c b/camel/camel-imapx-utils.c
index 08e4e0f..43bb86e 100644
--- a/camel/camel-imapx-utils.c
+++ b/camel/camel-imapx-utils.c
@@ -2205,7 +2205,6 @@ camel_imapx_parse_quota (CamelIMAPXStream *is,
        tok = camel_imapx_stream_token (is, &token, &len, cancellable, error);
        switch (tok) {
                case IMAPX_TOK_ERROR:
-               case IMAPX_TOK_PROTOCOL:
                        goto fail;
                case '(':
                        break;
@@ -2247,7 +2246,6 @@ quota_resource:
        tok = camel_imapx_stream_token (is, &token, &len, cancellable, error);
        switch (tok) {
                case IMAPX_TOK_ERROR:
-               case IMAPX_TOK_PROTOCOL:
                        goto fail;
                case ')':
                        break;
@@ -2320,7 +2318,7 @@ camel_imapx_parse_quotaroot (CamelIMAPXStream *is,
                        is, &token, &len, cancellable, error);
                if (tok == '\n')
                        break;
-               if (tok == IMAPX_TOK_ERROR || tok == IMAPX_TOK_PROTOCOL)
+               if (tok == IMAPX_TOK_ERROR)
                        goto fail;
                camel_imapx_stream_ungettoken (is, tok, token, len);
 


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