From: Milan Crha Date: Mon, 5 Nov 2012 19:51:41 +0000 (+0100) Subject: Use soup_message_headers_get_list() as a replacement of soup_message_headers_get() X-Git-Tag: upstream/3.7.4~242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aaf1f2cb931f00baaa9174ab3431b1783186797c;p=platform%2Fupstream%2Fevolution-data-server.git Use soup_message_headers_get_list() as a replacement of soup_message_headers_get() CalDAV backend didn't receive proper value for access right, which caused reject of the login to the server. --- diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c index 50ebbfd..107755e 100644 --- a/addressbook/backends/webdav/e-book-backend-webdav.c +++ b/addressbook/backends/webdav/e-book-backend-webdav.c @@ -170,7 +170,7 @@ download_contact (EBookBackendWebdav *webdav, return NULL; } - etag = soup_message_headers_get_one (message->response_headers, "ETag"); + etag = soup_message_headers_get_list (message->response_headers, "ETag"); /* we use our URI as UID */ contact = e_contact_new_from_vcard_with_uid (message->response_body->data, uri); @@ -249,9 +249,9 @@ upload_contact (EBookBackendWebdav *webdav, request, strlen (request)); status = soup_session_send_message (webdav->priv->session, message); - new_etag = soup_message_headers_get_one (message->response_headers, "ETag"); + new_etag = soup_message_headers_get_list (message->response_headers, "ETag"); - redir_uri = soup_message_headers_get_one (message->response_headers, "Location"); + redir_uri = soup_message_headers_get_list (message->response_headers, "Location"); /* set UID and REV fields */ e_contact_set (contact, E_CONTACT_REV, (gconstpointer) new_etag); diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c index e4a06e9..fdf7710 100644 --- a/calendar/backends/caldav/e-cal-backend-caldav.c +++ b/calendar/backends/caldav/e-cal-backend-caldav.c @@ -1019,7 +1019,7 @@ redirect_handler (SoupMessage *msg, SoupURI *new_uri; const gchar *new_loc; - new_loc = soup_message_headers_get_one (msg->response_headers, "Location"); + new_loc = soup_message_headers_get_list (msg->response_headers, "Location"); if (!new_loc) return; @@ -1134,7 +1134,7 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav, /* parse the dav header, we are intreseted in the * calendar-access bit only at the moment */ - header = soup_message_headers_get_one (message->response_headers, "DAV"); + header = soup_message_headers_get_list (message->response_headers, "DAV"); if (header) { calendar_access = soup_header_contains (header, "calendar-access"); cbdav->priv->calendar_schedule = soup_header_contains (header, "calendar-schedule"); @@ -1145,7 +1145,7 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav, /* parse the Allow header and look for PUT, DELETE at the * moment (maybe we should check more here, for REPORT eg) */ - header = soup_message_headers_get_one (message->response_headers, "Allow"); + header = soup_message_headers_get_list (message->response_headers, "Allow"); if (header) { put_allowed = soup_header_contains (header, "PUT"); delete_allowed = soup_header_contains (header, "DELETE"); @@ -1538,7 +1538,7 @@ caldav_server_get_object (ECalBackendCalDAV *cbdav, return FALSE; } - hdr = soup_message_headers_get_one (message->response_headers, "Content-Type"); + hdr = soup_message_headers_get_list (message->response_headers, "Content-Type"); if (hdr == NULL || g_ascii_strncasecmp (hdr, "text/calendar", 13)) { g_propagate_error (perror, EDC_ERROR (InvalidObject)); @@ -1548,7 +1548,7 @@ caldav_server_get_object (ECalBackendCalDAV *cbdav, return FALSE; } - hdr = soup_message_headers_get_one (message->response_headers, "ETag"); + hdr = soup_message_headers_get_list (message->response_headers, "ETag"); if (hdr != NULL) { g_free (object->etag); @@ -1716,13 +1716,13 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, if (status_code_to_result (message, cbdav, FALSE, perror)) { GError *local_error = NULL; - hdr = soup_message_headers_get_one (message->response_headers, "ETag"); + hdr = soup_message_headers_get_list (message->response_headers, "ETag"); if (hdr != NULL) { g_free (object->etag); object->etag = quote_etag (hdr); } else { /* no ETag header returned, check for it with a GET */ - hdr = soup_message_headers_get_one (message->response_headers, "Location"); + hdr = soup_message_headers_get_list (message->response_headers, "Location"); if (hdr) { /* reflect possible href change first */ gchar *file = strrchr (hdr, '/'); diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c index ca5e26b..30daea6 100644 --- a/calendar/backends/http/e-cal-backend-http.c +++ b/calendar/backends/http/e-cal-backend-http.c @@ -510,7 +510,7 @@ cal_backend_http_load (ECalBackendHttp *backend, if (SOUP_STATUS_IS_REDIRECTION (status_code)) { gboolean success; - newuri = soup_message_headers_get_one ( + newuri = soup_message_headers_get_list ( soup_message->response_headers, "Location"); d (g_message ("Redirected from %s to %s\n", async_context->uri, newuri));