diff options
author | Dan Winship <danw@src.gnome.org> | 2001-07-27 03:07:40 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-07-27 03:07:40 +0800 |
commit | 8e10bc69590b5594b95abcc8a8efd26bbdd86d2b (patch) | |
tree | 885f30495e5badc5bf61c2c7500c9212dcb9f9e6 /camel/providers/imap/camel-imap-command.h | |
parent | 2ea9d3637827b0be57dd0534b019931a4d0b08ed (diff) | |
download | gsoc2013-evolution-8e10bc69590b5594b95abcc8a8efd26bbdd86d2b.tar.gz gsoc2013-evolution-8e10bc69590b5594b95abcc8a8efd26bbdd86d2b.tar.zst gsoc2013-evolution-8e10bc69590b5594b95abcc8a8efd26bbdd86d2b.zip |
Send an IMAP command, but don't wait for responses.
* providers/imap/camel-imap-command.c (camel_imap_command_start):
Send an IMAP command, but don't wait for responses.
(camel_imap_command_response): Read a single line of response from
the server.
(camel_imap_command, etc): Reimplement in terms of the new code.
* providers/imap/camel-imap-folder.c (imap_rescan): Use
camel_imap_command_start and camel_imap_command_response, and
call camel_operation_progress after each line read from the
server.
(imap_update_summary): Likewise, although with more fudging on the
precentages... Also, fix this so that if none of the new messages
are cached, it only does a single FETCH, and if some of them are
cached, it does two FETCHes (one to get the UIDs, FLAGS, and
SIZEs, and another to get the bodies of all of the messages that
aren't cached now that it knows the relevant UIDs). This should
speed up startup a bunch (especially if you have high bandwidth
but also high latency to the IMAP server).
svn path=/trunk/; revision=11430
Diffstat (limited to 'camel/providers/imap/camel-imap-command.h')
-rw-r--r-- | camel/providers/imap/camel-imap-command.h | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/camel/providers/imap/camel-imap-command.h b/camel/providers/imap/camel-imap-command.h index ba9ca7010a..fbcf82ee7d 100644 --- a/camel/providers/imap/camel-imap-command.h +++ b/camel/providers/imap/camel-imap-command.h @@ -36,6 +36,13 @@ extern "C" { #include <glib.h> #include "camel-imap-types.h" +typedef enum { + CAMEL_IMAP_RESPONSE_ERROR, + CAMEL_IMAP_RESPONSE_CONTINUATION, + CAMEL_IMAP_RESPONSE_UNTAGGED, + CAMEL_IMAP_RESPONSE_TAGGED +} CamelImapResponseType; + struct _CamelImapResponse { CamelFolder *folder; GPtrArray *untagged; @@ -47,19 +54,27 @@ CamelImapResponse *camel_imap_command (CamelImapStore *store, CamelException *ex, const char *fmt, ...); CamelImapResponse *camel_imap_command_continuation (CamelImapStore *store, - CamelException *ex, - const char *cmdbuf); + const char *cmd, + CamelException *ex); + +void camel_imap_response_free (CamelImapStore *store, + CamelImapResponse *response); +void camel_imap_response_free_without_processing (CamelImapStore *store, + CamelImapResponse *response); +char *camel_imap_response_extract (CamelImapStore *store, + CamelImapResponse *response, + const char *type, + CamelException *ex); +char *camel_imap_response_extract_continuation (CamelImapStore *store, + CamelImapResponse *response, + CamelException *ex); -void camel_imap_response_free (CamelImapStore *store, - CamelImapResponse *response); -void camel_imap_response_free_without_processing(CamelImapStore *store, - CamelImapResponse *response); -char *camel_imap_response_extract (CamelImapStore *store, - CamelImapResponse *response, - const char *type, - CamelException *ex); -char *camel_imap_response_extract_continuation (CamelImapStore *store, - CamelImapResponse *response, - CamelException *ex); +gboolean camel_imap_command_start (CamelImapStore *store, + CamelFolder *folder, + CamelException *ex, + const char *fmt, ...); +CamelImapResponseType camel_imap_command_response (CamelImapStore *store, + char **respbuf, + CamelException *ex); #endif /* CAMEL_IMAP_COMMAND_H */ |