aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-11-10 00:53:29 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-11-10 00:53:29 +0800
commitdf5bede1f424f7829ddee0ec3d93e0bc47283c75 (patch)
tree7d45926222a37618049dce11c575e440366dce02
parentd8302b46aadfe37519d2e088681cada044c92d10 (diff)
downloadgsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.tar
gsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.tar.gz
gsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.tar.bz2
gsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.tar.lz
gsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.tar.xz
gsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.tar.zst
gsoc2013-evolution-df5bede1f424f7829ddee0ec3d93e0bc47283c75.zip
Handle not getting the CRLF pair together. Also don't require that we have
2004-11-09 Jeffrey Stedfast <fejj@novell.com> * providers/imap4/camel-imap4-stream.c (camel_imap4_stream_line): Handle not getting the CRLF pair together. Also don't require that we have at least 3 bytes in the read buffer as it is possible we don't have that much (see bug #69160). 2004-11-08 Jeffrey Stedfast <fejj@novell.com> * providers/imap4/camel-imap4-store.c (imap4_subscribe_folder): Note the folder-info just subscribed. (imap4_unsubscribe_folder): Unnote the folder-info. svn path=/trunk/; revision=27875
-rw-r--r--camel/ChangeLog13
-rw-r--r--camel/providers/imap4/camel-imap4-command.c8
-rw-r--r--camel/providers/imap4/camel-imap4-store-summary.c2
-rw-r--r--camel/providers/imap4/camel-imap4-store.c4
-rw-r--r--camel/providers/imap4/camel-imap4-stream.c14
5 files changed, 31 insertions, 10 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 847815130d..f343b0439b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,16 @@
+2004-11-09 Jeffrey Stedfast <fejj@novell.com>
+
+ * providers/imap4/camel-imap4-stream.c (camel_imap4_stream_line):
+ Handle not getting the CRLF pair together. Also don't require that
+ we have at least 3 bytes in the read buffer as it is possible we
+ don't have that much (see bug #69160).
+
+2004-11-08 Jeffrey Stedfast <fejj@novell.com>
+
+ * providers/imap4/camel-imap4-store.c (imap4_subscribe_folder):
+ Note the folder-info just subscribed.
+ (imap4_unsubscribe_folder): Unnote the folder-info.
+
2004-11-04 Jeffrey Stedfast <fejj@novell.com>
* providers/imap4/camel-imap4-engine.c: Added much in-line
diff --git a/camel/providers/imap4/camel-imap4-command.c b/camel/providers/imap4/camel-imap4-command.c
index b01abe9141..e869bee9c3 100644
--- a/camel/providers/imap4/camel-imap4-command.c
+++ b/camel/providers/imap4/camel-imap4-command.c
@@ -602,7 +602,7 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
goto exception;
} else if (token.token == CAMEL_IMAP4_TOKEN_ATOM && !strcmp (token.v.atom, ic->tag)) {
/* we got "<tag> OK/NO/BAD" */
- fprintf (stderr, "got %s response\n", token.v.atom);
+ d(fprintf (stderr, "got %s response\n", token.v.atom));
if (camel_imap4_engine_next_token (engine, &token, &ic->ex) == -1)
goto exception;
@@ -616,7 +616,7 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
result = CAMEL_IMAP4_RESULT_BAD;
if (result == CAMEL_IMAP4_RESULT_NONE) {
- fprintf (stderr, "expected OK/NO/BAD but got %s\n", token.v.atom);
+ d(fprintf (stderr, "expected OK/NO/BAD but got %s\n", token.v.atom));
goto unexpected;
}
@@ -634,18 +634,22 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
goto exception;
}
} else {
+#if d(!)0
fprintf (stderr, "expected anything but this: ");
unexpected_token (&token);
fprintf (stderr, "\n");
+#endif
goto unexpected;
}
break;
} else {
+#if d(!)0
fprintf (stderr, "wtf is this: ");
unexpected_token (&token);
fprintf (stderr, "\n");
+#endif
unexpected:
diff --git a/camel/providers/imap4/camel-imap4-store-summary.c b/camel/providers/imap4/camel-imap4-store-summary.c
index 7c08469acf..ffa4bd05f1 100644
--- a/camel/providers/imap4/camel-imap4-store-summary.c
+++ b/camel/providers/imap4/camel-imap4-store-summary.c
@@ -180,7 +180,7 @@ summary_header_load (CamelStoreSummary *s, FILE *in)
is->version = version;
if (version < CAMEL_IMAP4_STORE_SUMMARY_VERSION_0) {
- g_warning ("Store summary header version too low");
+ g_warning ("IMAP4 store summary header version too low");
errno = EINVAL;
return -1;
}
diff --git a/camel/providers/imap4/camel-imap4-store.c b/camel/providers/imap4/camel-imap4-store.c
index adf8ffbbe4..890ff4797d 100644
--- a/camel/providers/imap4/camel-imap4-store.c
+++ b/camel/providers/imap4/camel-imap4-store.c
@@ -1323,6 +1323,8 @@ imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelExcepti
fi->unread = -1;
fi->total = -1;
+ camel_imap4_store_summary_note_info (((CamelIMAP4Store *) store)->summary, fi);
+
camel_object_trigger_event (store, "folder_subscribed", fi);
camel_folder_info_free (fi);
break;
@@ -1394,6 +1396,8 @@ imap4_unsubscribe_folder (CamelStore *store, const char *folder_name, CamelExcep
fi->unread = -1;
fi->total = -1;
+ camel_imap4_store_summary_unnote_info (((CamelIMAP4Store *) store)->summary, fi);
+
camel_object_trigger_event (store, "folder_unsubscribed", fi);
camel_folder_info_free (fi);
break;
diff --git a/camel/providers/imap4/camel-imap4-stream.c b/camel/providers/imap4/camel-imap4-stream.c
index 42100b04de..32d1a20b40 100644
--- a/camel/providers/imap4/camel-imap4-stream.c
+++ b/camel/providers/imap4/camel-imap4-stream.c
@@ -631,8 +631,7 @@ camel_imap4_stream_line (CamelIMAP4Stream *stream, unsigned char **line, size_t
g_return_val_if_fail (line != NULL, -1);
g_return_val_if_fail (len != NULL, -1);
- if ((stream->inend - stream->inptr) < 3) {
- /* keep our buffer full to the optimal size */
+ if ((stream->inend - stream->inptr) < 2 && *stream->inptr != '\n') {
if (imap4_fill (stream) == -1 && stream->inptr == stream->inend)
return -1;
}
@@ -646,15 +645,16 @@ camel_imap4_stream_line (CamelIMAP4Stream *stream, unsigned char **line, size_t
inptr++;
*len = (inptr - stream->inptr);
+
+ if (inptr > stream->inptr && inptr[-1] == '\r')
+ inptr[-1] = '\0';
+
if (inptr < inend) {
/* got the eoln */
- if (inptr > stream->inptr && inptr[-1] == '\r')
- inptr[-1] = '\0';
- else
- inptr[0] = '\0';
+ inptr[0] = '\0';
+ *len += 1;
stream->inptr = inptr + 1;
- *len += 1;
return 0;
}