diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-06-28 06:44:19 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-28 06:44:19 +0800 |
commit | 8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b (patch) | |
tree | d4c126134503398810c04cebd975ef07ea358653 /camel/providers/imap/camel-imap-stream.c | |
parent | f704f45bbf6561376cb41236d3fa205689718c58 (diff) | |
download | gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.tar gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.tar.gz gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.tar.bz2 gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.tar.lz gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.tar.xz gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.tar.zst gsoc2013-evolution-8b6fb870d7c9015ead885c4bbc8d6bc272d3f88b.zip |
Move the CAPABILITY command here so we don't have to keep checking each
2000-06-27 Jeffrey Stedfast <fejj@helixcode.com>
* providers/imap/camel-imap-store.c (imap_connect): Move the
CAPABILITY command here so we don't have to keep checking
each time we open a folder.
(camel_imap_command_extended): If we are doing an EXAMINE,
don't bother doing a SELECT first.
* providers/imap/camel-imap-folder.c (imap_init): Update so
folder->has_search_capability depends on the parent IMAP store
(since this is really dependant on the IMAP implementation and
not the folder)
svn path=/trunk/; revision=3767
Diffstat (limited to 'camel/providers/imap/camel-imap-stream.c')
-rw-r--r-- | camel/providers/imap/camel-imap-stream.c | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/camel/providers/imap/camel-imap-stream.c b/camel/providers/imap/camel-imap-stream.c index 43b1afb61a..74d46eb95c 100644 --- a/camel/providers/imap/camel-imap-stream.c +++ b/camel/providers/imap/camel-imap-stream.c @@ -95,10 +95,10 @@ camel_imap_stream_new (CamelImapFolder *folder, char *command) imap_stream = gtk_type_new (camel_imap_stream_get_type ()); - imap_stream->folder = folder; - gtk_object_ref(GTK_OBJECT (imap_stream->folder)); + imap_stream->folder = folder; + gtk_object_ref (GTK_OBJECT (imap_stream->folder)); - imap_stream->command = g_strdup(command); + imap_stream->command = g_strdup (command); return CAMEL_STREAM (imap_stream); } @@ -108,11 +108,11 @@ finalize (GtkObject *object) { CamelImapStream *imap_stream = CAMEL_IMAP_STREAM (object); - g_free(imap_stream->cache); - g_free(imap_stream->command); + g_free (imap_stream->cache); + g_free (imap_stream->command); if (imap_stream->folder) - gtk_object_unref(GTK_OBJECT (imap_stream->folder)); + gtk_object_unref (GTK_OBJECT (imap_stream->folder)); GTK_OBJECT_CLASS (parent_class)->finalize (object); } @@ -130,30 +130,30 @@ stream_read (CamelStream *stream, char *buffer, size_t n) CamelFolder *folder = CAMEL_FOLDER (imap_stream->folder); gint status; - status = camel_imap_command_extended(CAMEL_IMAP_STORE (folder->parent_store), - CAMEL_FOLDER (imap_stream->folder), - &imap_stream->cache, "%s", - imap_stream->command); - + status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), + CAMEL_FOLDER (imap_stream->folder), + &imap_stream->cache, "%s", + imap_stream->command); + if (status != CAMEL_IMAP_OK) { /* we got an error, dump this stuff */ - g_free(imap_stream->cache); + g_free (imap_stream->cache); imap_stream->cache = NULL; return -1; } /* we don't need the folder anymore... */ - gtk_object_unref(GTK_OBJECT (imap_stream->folder)); + gtk_object_unref (GTK_OBJECT (imap_stream->folder)); imap_stream->cache_ptr = imap_stream->cache; } /* we've already read this stream, so return whats in the cache */ - nread = MIN (n, strlen(imap_stream->cache_ptr)); + nread = MIN (n, strlen (imap_stream->cache_ptr)); if (nread > 0) { - memcpy(buffer, imap_stream->cache_ptr, nread); + memcpy (buffer, imap_stream->cache_ptr, nread); imap_stream->cache_ptr += nread; } else { nread = -1; @@ -177,16 +177,5 @@ stream_eos (CamelStream *stream) { CamelImapStream *imap_stream = CAMEL_IMAP_STREAM (stream); - return (imap_stream->cache_ptr && strlen(imap_stream->cache_ptr)); + return (imap_stream->cache_ptr && strlen (imap_stream->cache_ptr)); } - - - - - - - - - - - |