aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap4/camel-imap4-engine.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-07-28 03:38:51 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-07-28 03:38:51 +0800
commit7fcf69af0f8a9019d5114a4741ff1bbf3aa9a3dc (patch)
treef34c5482994fe0ba6c753b0d8ca96ff0bb68c170 /camel/providers/imap4/camel-imap4-engine.c
parentfd83a09d5ced1b3a89dcf122e7ec47d5985de062 (diff)
downloadgsoc2013-evolution-7fcf69af0f8a9019d5114a4741ff1bbf3aa9a3dc.tar.gz
gsoc2013-evolution-7fcf69af0f8a9019d5114a4741ff1bbf3aa9a3dc.tar.zst
gsoc2013-evolution-7fcf69af0f8a9019d5114a4741ff1bbf3aa9a3dc.zip
Changed to be the same prototype as engine_queue().
2004-07-27 Jeffrey Stedfast <fejj@novell.com> * providers/imap4/camel-imap4-engine.c (camel_imap4_engine_prequeue): Changed to be the same prototype as engine_queue(). (engine_prequeue_folder_select): Updated. * providers/imap4/camel-imap4-store.c (connect_to_server): Use engine_prequeue() for STARTTLS in case we are reconnecting and already have a command queue. (imap4_try_authenticate): Use prequeue() here too. (imap4_reconnect): Moved all the connect logic in here. (imap4_connect): just lock and call reconnect(). svn path=/trunk/; revision=26748
Diffstat (limited to 'camel/providers/imap4/camel-imap4-engine.c')
-rw-r--r--camel/providers/imap4/camel-imap4-engine.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/camel/providers/imap4/camel-imap4-engine.c b/camel/providers/imap4/camel-imap4-engine.c
index 40501ae399..ce5f83e38f 100644
--- a/camel/providers/imap4/camel-imap4-engine.c
+++ b/camel/providers/imap4/camel-imap4-engine.c
@@ -1173,8 +1173,7 @@ engine_prequeue_folder_select (CamelIMAP4Engine *engine)
}
/* we need to pre-queue a SELECT */
- ic = camel_imap4_command_new (engine, ic->folder, "SELECT %F\r\n", ic->folder);
- camel_imap4_engine_prequeue (engine, ic);
+ ic = camel_imap4_engine_prequeue (engine, (CamelFolder *) ic->folder, "SELECT %F\r\n", ic->folder);
ic->user_data = engine;
camel_imap4_command_unref (ic);
@@ -1280,7 +1279,7 @@ camel_imap4_engine_iterate (CamelIMAP4Engine *engine)
* @format: command format
* @Varargs: arguments
*
- * Basically the same as #camel_imap4_command_new() except that this
+ * Basically the same as camel_imap4_command_new() except that this
* function also places the command in the engine queue.
*
* Returns the CamelIMAP4Command.
@@ -1291,6 +1290,8 @@ camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder, const c
CamelIMAP4Command *ic;
va_list args;
+ g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), NULL);
+
va_start (args, format);
ic = camel_imap4_command_newv (engine, (CamelIMAP4Folder *) folder, format, args);
va_end (args);
@@ -1306,17 +1307,26 @@ camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder, const c
/**
* camel_imap4_engine_prequeue:
* @engine: IMAP4 engine
- * @ic: IMAP4 command to pre-queue
+ * @folder: IMAP4 folder that the command will affect (or %NULL if it doesn't matter)
+ * @format: command format
+ * @Varargs: arguments
+ *
+ * Same as camel_imap4_engine_queue() except this places the new
+ * command at the head of the queue.
*
- * Places @ic at the head of the queue of pending IMAP4 commands.
+ * Returns the CamelIMAP4Command.
**/
-void
-camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
+CamelIMAP4Command *
+camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelFolder *folder, const char *format, ...)
{
- g_return_if_fail (CAMEL_IS_IMAP4_ENGINE (engine));
- g_return_if_fail (ic != NULL);
+ CamelIMAP4Command *ic;
+ va_list args;
- camel_imap4_command_ref (ic);
+ g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), NULL);
+
+ va_start (args, format);
+ ic = camel_imap4_command_newv (engine, (CamelIMAP4Folder *) folder, format, args);
+ va_end (args);
if (e_dlist_empty (&engine->queue)) {
e_dlist_addtail (&engine->queue, (EDListNode *) ic);
@@ -1340,6 +1350,10 @@ camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
}
}
}
+
+ camel_imap4_command_ref (ic);
+
+ return ic;
}