[evolution/express-offline-mail-guesser: 1/5] Factor out function to parse a soup message from a string



commit 061383357859f808a900ca8399fec2053f80a089
Author: Federico Mena Quintero <federico novell com>
Date:   Tue Mar 16 13:06:34 2010 -0600

    Factor out function to parse a soup message from a string
    
    We'll need this when we want to parse a pre-cached file for the account configuration guesser.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 capplet/settings/mail-guess-servers.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c
index ef656bf..891bdb1 100644
--- a/capplet/settings/mail-guess-servers.c
+++ b/capplet/settings/mail-guess-servers.c
@@ -160,12 +160,12 @@ handle_outgoing (xmlNodePtr head, EmailProvider *provider)
 }
 
 static void
-parse_msg (SoupMessage *msg, EmailProvider *provider)
+parse_message (const char *msg, int length, EmailProvider *provider)
 {
 	xmlDocPtr doc;
 	xmlNodePtr node, top;
 
-	doc = xmlReadMemory ((xmlChar *) msg->response_body->data, msg->response_body->length, "file.xml", NULL, 0);
+	doc = xmlReadMemory (msg, length, "file.xml", NULL, 0);
 
 	node = doc->children;
 	while (node) {
@@ -210,6 +210,12 @@ parse_msg (SoupMessage *msg, EmailProvider *provider)
 	xmlFreeDoc(doc);
 }
 
+static gboolean
+parse_soup_message (SoupMessage *msg, EmailProvider *provider)
+{
+	parse_message (msg->response_body->data, msg->response_body->length, provider);
+}
+
 gboolean
 mail_guess_servers(EmailProvider *provider)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]