From cd14d28ca592cccf52c2c886334f266c1ac46359 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 17 Jan 2008 14:54:10 +0000 Subject: Port to libsoup 2.4. Plug a leak. * gui/itip-utils.c (itip_publish_comp): Port to libsoup 2.4. Plug a leak. svn path=/trunk/; revision=34846 --- calendar/ChangeLog | 5 +++++ calendar/gui/itip-utils.c | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d333e90f5d..70651d79e0 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2008-01-17 Dan Winship + + * gui/itip-utils.c (itip_publish_comp): Port to libsoup 2.4. Plug + a leak. + 2008-01-17 Milan Crha ** Fix for bug #509879 diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 63b0163ef9..beeec18e4b 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -36,9 +36,7 @@ #include #include #include -#include -#include -#include +#include #include "calendar-config.h" #include "itip-utils.h" #include @@ -1748,7 +1746,7 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, icalcomponent *icomp = NULL; SoupSession *session; SoupMessage *msg; - SoupUri *real_uri; + SoupURI *real_uri; char *ical_string; toplevel = e_cal_util_new_top_level (); @@ -1773,18 +1771,19 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, return FALSE; } - real_uri->user = g_strdup (username); - real_uri->passwd = g_strdup (password); + soup_uri_set_user (real_uri, username); + soup_uri_set_password (real_uri, password); - /* build the SOAP message */ + /* build the message */ msg = soup_message_new_from_uri (SOUP_METHOD_PUT, real_uri); + soup_uri_free (real_uri); if (!msg) { g_warning (G_STRLOC ": Could not build SOAP message"); g_object_unref (session); return FALSE; } soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); - soup_message_set_request (msg, "text/calendar", SOUP_BUFFER_USER_OWNED, + soup_message_set_request (msg, "text/calendar", SOUP_MEMORY_TEMPORARY, ical_string, strlen (ical_string)); /* send message to server */ @@ -1792,12 +1791,13 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { g_warning(G_STRLOC ": Could not publish Free/Busy: %d: %s", msg->status_code, - soup_status_get_phrase (msg->status_code)); + msg->reason_phrase); + g_object_unref (msg); g_object_unref (session); return FALSE; } - soup_uri_free (real_uri); + g_object_unref (msg); g_object_unref (session); return TRUE; -- cgit