aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap4/camel-imap4-stream.c
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 /camel/providers/imap4/camel-imap4-stream.c
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
Diffstat (limited to 'camel/providers/imap4/camel-imap4-stream.c')
-rw-r--r--camel/providers/imap4/camel-imap4-stream.c14
1 files changed, 7 insertions, 7 deletions
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;
}