[evolution/wip/mcrha/soup3] Mostly buildable, except of libgweather4
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/mcrha/soup3] Mostly buildable, except of libgweather4
- Date: Thu, 11 Nov 2021 11:58:51 +0000 (UTC)
commit 49f07f21d00a2191378be530b4226d4b5dbe47bf
Author: Milan Crha <mcrha redhat com>
Date: Thu Nov 11 12:57:53 2021 +0100
Mostly buildable, except of libgweather4
CMakeLists.txt | 4 +-
README.md | 2 +-
evolution-shell.pc.in | 2 +-
src/calendar/gui/e-meeting-store.c | 85 ++++-------
src/e-util/e-misc-utils.c | 2 +-
src/em-format/e-mail-part-utils.c | 2 +-
src/mail/e-http-request.c | 158 ++++++---------------
src/mail/e-mail-autoconfig.c | 25 ++--
src/mail/e-mail-display.c | 8 +-
.../evolution-book-config-carddav.c | 2 +-
.../e-google-book-chooser-button.c | 2 +-
.../evolution-cal-config-caldav.c | 2 +-
.../cal-config-google/e-google-chooser-button.c | 2 +-
.../evolution-cal-config-webdav-notes.c | 2 +-
src/modules/calendar/e-cal-base-shell-backend.c | 4 +-
src/modules/gravatar/e-gravatar-photo-source.c | 16 +--
16 files changed, 111 insertions(+), 207 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee6e093661..d238c55c68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,7 +82,7 @@ set(gsettings_desktop_schemas_minimum_version 2.91.92)
set(libpst_minimum_version 0.6.54)
set(libxml_minimum_version 2.7.3)
set(shared_mime_info_minimum_version 0.22)
-set(webkit2gtk_minimum_version 2.28.0)
+set(webkit2gtk_minimum_version 2.34.0)
# Optional Packages
set(champlain_minimum_version 0.12)
@@ -279,7 +279,7 @@ pkg_check_modules(EVOLUTION_DATA_SERVER REQUIRED
pkg_check_modules(A11Y REQUIRED atk)
pkg_check_modules(LIBSOUP REQUIRED libsoup-3.0>=${soup_minimum_version})
-pkg_check_modules(WEB_EXTENSION REQUIRED webkit2gtk-4.0>=${webkit2gtk_minimum_version})
+pkg_check_modules(WEB_EXTENSION REQUIRED webkit2gtk-4.1>=${webkit2gtk_minimum_version})
pkg_check_variable(EDS_SOURCES_DBUS_SERVICE_NAME evolution-data-server-1.2 sourcesdbusservicename)
diff --git a/README.md b/README.md
index 45abb13bc6..b4f7a4aa06 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ Additional dependencies, besides the stock GNOME libraries (the
dependencies should be compiled in the order they are listed here):
* [evolution-data-server of the same version as the Evolution is][eds]
-* [libsoup 2.42 or later][libsoup]
+* [libsoup 3.0 or later][libsoup]
* [WebKitGTK+ 2.28.0][webkitgtk]
* [Mozilla NSPR/NSS libraries][mozilla]
These are needed if you want to compile Evolution with SSL and S/MIME
diff --git a/evolution-shell.pc.in b/evolution-shell.pc.in
index 04a252d02e..8226e3d72a 100644
--- a/evolution-shell.pc.in
+++ b/evolution-shell.pc.in
@@ -17,7 +17,7 @@ execversion=@BASE_VERSION@
Name: evolution-shell
Description: libraries needed for Evolution shell components
Version: @PROJECT_VERSION@
-Requires: gtk+-3.0 libebackend-1.2 libedataserver-1.2 libedataserverui-1.2 webkit2gtk-4.0
+Requires: gtk+-3.0 libebackend-1.2 libedataserver-1.2 libedataserverui-1.2 webkit2gtk-4.1
@shell_private_requirements@
Libs: -L${privlibdir} -levolution-shell -levolution-util@shell_privlibdir_rpath_flags@
Cflags: -I${privincludedir}
diff --git a/src/calendar/gui/e-meeting-store.c b/src/calendar/gui/e-meeting-store.c
index 68f545ca2a..1737e6d2c0 100644
--- a/src/calendar/gui/e-meeting-store.c
+++ b/src/calendar/gui/e-meeting-store.c
@@ -1957,9 +1957,8 @@ async_read (GObject *source_object,
}
}
-static void
-soup_authenticate (SoupSession *session,
- SoupMessage *msg,
+static gboolean
+soup_authenticate (SoupMessage *msg,
SoupAuth *auth,
gboolean retrying,
gpointer data)
@@ -1968,19 +1967,19 @@ soup_authenticate (SoupSession *session,
const gchar *orig_uri;
gboolean tried = FALSE;
- g_return_if_fail (msg != NULL);
- g_return_if_fail (auth != NULL);
+ g_return_val_if_fail (msg != NULL, FALSE);
+ g_return_val_if_fail (auth != NULL, FALSE);
orig_uri = g_object_get_data (G_OBJECT (msg), "orig-uri");
- g_return_if_fail (orig_uri != NULL);
+ g_return_val_if_fail (orig_uri != NULL, FALSE);
guri = g_uri_parse (orig_uri, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
if (!guri)
- return;
+ return FALSE;
if (!g_uri_get_user (guri) || !g_uri_get_user (guri)[0]) {
g_uri_unref (guri);
- return;
+ return FALSE;
}
if (!retrying) {
@@ -2019,11 +2018,11 @@ soup_authenticate (SoupSession *session,
g_free (bold_host);
g_free (bold_user);
- if (retrying && msg->reason_phrase && *msg->reason_phrase) {
+ if (retrying && soup_message_get_reason_phrase (msg) && *soup_message_get_reason_phrase
(msg)) {
g_string_append_c (description, '\n');
g_string_append_printf (
description, _("Failure reason: %s"),
- msg->reason_phrase);
+ soup_message_get_reason_phrase (msg));
}
password = e_passwords_ask_password (
@@ -2044,62 +2043,38 @@ soup_authenticate (SoupSession *session,
}
g_uri_unref (guri);
-}
-
-static void
-redirect_handler (SoupMessage *msg,
- gpointer user_data)
-{
- if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
- SoupSession *soup_session = user_data;
- GUri *new_uri;
- const gchar *new_loc;
- new_loc = soup_message_headers_get_list (msg->response_headers, "Location");
- if (!new_loc)
- return;
-
- new_uri = g_uri_parse_relative (soup_message_get_uri (msg), new_loc, SOUP_HTTP_URI_FLAGS |
G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (!new_uri) {
- soup_message_set_status_full (
- msg,
- SOUP_STATUS_MALFORMED,
- "Invalid Redirect URL");
- return;
- }
-
- soup_message_set_uri (msg, new_uri);
- soup_session_requeue_message (soup_session, msg);
-
- g_uri_unref (new_uri);
- }
+ return FALSE;
}
static void
-soup_msg_ready_cb (SoupSession *session,
- SoupMessage *msg,
+soup_msg_ready_cb (GObject *source_object,
+ GAsyncResult *result,
gpointer user_data)
{
EMeetingStoreQueueData *qdata = user_data;
+ GBytes *bytes;
+ GError *local_error = NULL;
- g_return_if_fail (session != NULL);
- g_return_if_fail (msg != NULL);
+ g_return_if_fail (source_object != NULL);
g_return_if_fail (qdata != NULL);
- if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
+ bytes = soup_session_send_and_read_finish (SOUP_SESSION (source_object), result, &local_error);
+ if (bytes && !local_error) {
qdata->string = g_string_new_len (
- msg->response_body->data,
- msg->response_body->length);
+ g_bytes_get_data (bytes, NULL),
+ g_bytes_get_size (bytes));
process_free_busy (qdata, qdata->string->str);
} else {
g_warning (
"Unable to access free/busy url: %s",
- msg->reason_phrase && *msg->reason_phrase ?
- msg->reason_phrase : (soup_status_get_phrase (
- msg->status_code) ? soup_status_get_phrase (
- msg->status_code) : "Unknown error"));
+ local_error ? local_error->message : "Unknown error");
process_callbacks (qdata);
}
+
+ if (bytes)
+ g_bytes_unref (bytes);
+ g_clear_error (&local_error);
}
static void
@@ -2122,17 +2097,13 @@ download_with_libsoup (const gchar *uri,
g_object_set_data_full (G_OBJECT (msg), "orig-uri", g_strdup (uri), g_free);
session = soup_session_new ();
- g_object_set (session, SOUP_SESSION_TIMEOUT, 90, NULL);
+ g_object_set (session, "timeout", 60, NULL);
g_signal_connect (
- session, "authenticate",
+ msg, "authenticate",
G_CALLBACK (soup_authenticate), NULL);
- soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
- soup_message_add_header_handler (
- msg, "got_body", "Location",
- G_CALLBACK (redirect_handler), session);
- soup_message_headers_append (msg->request_headers, "Connection", "close");
- soup_session_queue_message (session, msg, soup_msg_ready_cb, qdata);
+ soup_message_headers_append (soup_message_get_request_headers (msg), "Connection", "close");
+ soup_session_send_and_read_async (session, msg, G_PRIORITY_DEFAULT, NULL, soup_msg_ready_cb, qdata);
}
static void
diff --git a/src/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c
index a39249612a..095e0aeaa7 100644
--- a/src/e-util/e-misc-utils.c
+++ b/src/e-util/e-misc-utils.c
@@ -2878,7 +2878,7 @@ e_binding_transform_text_to_uri (GBinding *binding,
uri = g_uri_parse (text, SOUP_HTTP_URI_FLAGS, NULL);
if (!uri)
- uri = g_uri_build (G_URI_FLAGS_NONE, "http:", NULL, NULL, -1, "", NULL, NULL);
+ uri = g_uri_build (G_URI_FLAGS_NONE, "http", NULL, NULL, -1, "", NULL, NULL);
source_binding = g_binding_get_source (binding);
diff --git a/src/em-format/e-mail-part-utils.c b/src/em-format/e-mail-part-utils.c
index 363d74f71e..c6aa91ac5c 100644
--- a/src/em-format/e-mail-part-utils.c
+++ b/src/em-format/e-mail-part-utils.c
@@ -563,7 +563,7 @@ e_mail_part_build_uri (CamelFolder *folder,
}
case G_TYPE_STRING: {
gchar *val = va_arg (ap, gchar *);
- gchar *escaped = g_uri_escape_string (val, NULL);
+ gchar *escaped = g_uri_escape_string (val, NULL, FALSE);
tmp2 = g_strdup_printf (
"%s%c%s=%s", tmp,
separator, name, escaped);
diff --git a/src/mail/e-http-request.c b/src/mail/e-http-request.c
index 5041c21dfc..a30911e801 100644
--- a/src/mail/e-http-request.c
+++ b/src/mail/e-http-request.c
@@ -19,10 +19,7 @@
#include <string.h>
-#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include <libsoup/soup.h>
-#include <libsoup/soup-requester.h>
-#include <libsoup/soup-request-http.h>
#include <camel/camel.h>
#include <webkit2/webkit2.h>
@@ -97,73 +94,6 @@ copy_stream_to_stream (GIOStream *file_io_stream,
return total_len;
}
-static void
-redirect_handler (SoupMessage *msg,
- gpointer user_data)
-{
- if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
- SoupSession *soup_session = user_data;
- GUri *new_uri;
- const gchar *new_loc;
-
- new_loc = soup_message_headers_get_list (soup_message_get_response_headers (msg), "Location");
- if (new_loc == NULL)
- return;
-
- new_uri = g_uri_parse_relative (soup_message_get_uri (msg), new_loc, SOUP_HTTP_URI_FLAGS |
G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (new_uri == NULL) {
- soup_message_set_status_full (
- msg,
- SOUP_STATUS_MALFORMED,
- "Invalid Redirect URL");
- return;
- }
-
- soup_message_set_uri (msg, new_uri);
- soup_session_requeue_message (soup_session, msg);
-
- g_uri_unref (new_uri);
- }
-}
-
-static void
-send_and_handle_redirection (SoupSession *session,
- SoupMessage *message,
- gchar **new_location)
-{
- GUri *guri;
- gchar *old_uri = NULL;
-
- g_return_if_fail (message != NULL);
-
- guri = soup_message_get_uri (message);
-
- if (new_location != NULL)
- old_uri = g_uri_to_string_partial (guri, G_URI_HIDE_PASSWORD);
-
- soup_message_set_flags (message, SOUP_MESSAGE_NO_REDIRECT);
- soup_message_add_header_handler (
- message, "got_body", "Location",
- G_CALLBACK (redirect_handler), session);
- soup_message_headers_append (
- soup_message_get_request_headers (message), "Connection", "close");
- soup_session_send_message (session, message);
-
- if (new_location != NULL) {
- gchar *new_loc;
-
- new_loc = g_uri_to_string_partial (guri, G_URI_HIDE_PASSWORD)
-
- if (new_loc && old_uri && !g_str_equal (new_loc, old_uri)) {
- *new_location = new_loc;
- } else {
- g_free (new_loc);
- }
- }
-
- g_free (old_uri);
-}
-
static void
http_request_cancelled_cb (GCancellable *cancellable,
SoupSession *session)
@@ -410,7 +340,7 @@ e_http_request_process_sync (EContentRequest *request,
SoupSession *temp_session;
SoupMessage *message;
GIOStream *cache_stream;
- GMainContext *context;
+ GInputStream *input_stream;
gulong cancelled_id = 0;
if (g_cancellable_set_error_if_cancelled (cancellable, error))
@@ -422,39 +352,33 @@ e_http_request_process_sync (EContentRequest *request,
goto cleanup;
}
- context = g_main_context_new ();
- g_main_context_push_thread_default (context);
-
- temp_session = soup_session_new_with_options (
- SOUP_SESSION_TIMEOUT, 90, NULL);
-
proxy_source = e_source_registry_ref_builtin_proxy (e_shell_get_registry (shell));
- g_object_set (
- temp_session,
- SOUP_SESSION_PROXY_RESOLVER,
- G_PROXY_RESOLVER (proxy_source),
+ temp_session = soup_session_new_with_options (
+ "timeout", 90,
+ "proxy-resolver", proxy_source,
NULL);
g_object_unref (proxy_source);
soup_message_headers_append (
- message->request_headers,
+ soup_message_get_request_headers (message),
"User-Agent", "Evolution/" VERSION);
if (cancellable)
cancelled_id = g_cancellable_connect (cancellable, G_CALLBACK
(http_request_cancelled_cb), temp_session, NULL);
- send_and_handle_redirection (temp_session, message, NULL);
+ soup_message_headers_append (soup_message_get_request_headers (message), "Connection",
"close");
+ input_stream = soup_session_send (temp_session, message, cancellable, NULL);
if (cancellable && cancelled_id)
g_cancellable_disconnect (cancellable, cancelled_id);
- if (!SOUP_STATUS_IS_SUCCESSFUL (message->status_code)) {
- g_debug ("Failed to request %s (code %d)", use_uri, message->status_code);
+ if (!input_stream || !SOUP_STATUS_IS_SUCCESSFUL (soup_message_get_status (message))) {
+ g_debug ("Failed to request %s (code %d)", use_uri, soup_message_get_status
(message));
g_object_unref (message);
g_object_unref (temp_session);
- g_main_context_unref (context);
+ g_clear_object (&input_stream);
goto cleanup;
}
@@ -470,52 +394,60 @@ e_http_request_process_sync (EContentRequest *request,
g_clear_error (&local_error);
} else {
GOutputStream *output_stream;
+ gssize bytes_copied;
- output_stream =
- g_io_stream_get_output_stream (cache_stream);
-
- success = g_output_stream_write_all (
- output_stream,
- message->response_body->data,
- message->response_body->length,
- NULL, cancellable, &local_error);
+ output_stream = g_io_stream_get_output_stream (cache_stream);
+ bytes_copied = g_output_stream_splice (output_stream, input_stream,
G_OUTPUT_STREAM_SPLICE_NONE, cancellable, &local_error);
g_io_stream_close (cache_stream, NULL, NULL);
g_object_unref (cache_stream);
if (local_error != NULL) {
if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning (
- "Failed to write data to cache stream: %s",
- local_error->message);
+ g_warning ("Failed to write data to cache stream: %s",
local_error->message);
g_clear_error (&local_error);
g_object_unref (message);
g_object_unref (temp_session);
- g_main_context_unref (context);
+ g_clear_object (&input_stream);
goto cleanup;
}
- if (success) {
- /* Send the response body to WebKit */
- stream = g_memory_input_stream_new_from_data (
- g_memdup (
- message->response_body->data,
- message->response_body->length),
- message->response_body->length,
- (GDestroyNotify) g_free);
-
- *out_stream = stream;
- *out_stream_length = message->response_body->length;
- *out_mime_type = g_strdup (
- soup_message_headers_get_content_type (
- message->response_headers, NULL));
+ if (bytes_copied >= 0) {
+ gchar *filename;
+
+ filename = camel_data_cache_get_filename (cache, "http", uri_md5);
+
+ if (filename) {
+ GFileInputStream *file_input_stream;
+ GFile *file;
+
+ file = g_file_new_for_path (filename);
+ file_input_stream = g_file_read (file, cancellable,
&local_error);
+
+ g_object_unref (file);
+
+ if (file_input_stream) {
+ *out_stream = G_INPUT_STREAM (file_input_stream);
+ *out_stream_length = bytes_copied;
+ *out_mime_type = g_strdup
(soup_message_headers_get_content_type (soup_message_get_response_headers (message), NULL));
+
+ success = TRUE;
+ } else {
+ g_warning ("Failed to read cache file '%s': %s",
filename, local_error ? local_error->message : "Unknown error");
+ g_clear_error (&local_error);
+ }
+
+ g_free (filename);
+ } else {
+ g_warning ("Failed to get just written cache file name");
+ }
}
}
}
g_object_unref (message);
g_object_unref (temp_session);
- g_main_context_unref (context);
+ g_clear_object (&input_stream);
d (printf ("Received image from %s\n"
"Content-Type: %s\n"
diff --git a/src/mail/e-mail-autoconfig.c b/src/mail/e-mail-autoconfig.c
index fdd45daef4..03efcb1d70 100644
--- a/src/mail/e-mail-autoconfig.c
+++ b/src/mail/e-mail-autoconfig.c
@@ -501,8 +501,9 @@ mail_autoconfig_lookup_uri_sync (EMailAutoconfig *autoconfig,
GError **error)
{
SoupMessage *soup_message;
+ GBytes *data;
gboolean success;
- guint status;
+ GError *local_error = NULL;
soup_message = soup_message_new (SOUP_METHOD_GET, uri);
@@ -513,14 +514,14 @@ mail_autoconfig_lookup_uri_sync (EMailAutoconfig *autoconfig,
}
soup_message_headers_append (
- soup_message->request_headers,
+ soup_message_get_request_headers (soup_message),
"User-Agent", "Evolution/" VERSION VERSION_SUBSTRING " " VERSION_COMMENT);
- status = soup_session_send_message (soup_session, soup_message);
+ data = soup_session_send_and_read (soup_session, soup_message, cancellable, &local_error);
- success = SOUP_STATUS_IS_SUCCESSFUL (status);
+ success = SOUP_STATUS_IS_SUCCESSFUL (soup_message_get_status (soup_message));
- if (success) {
+ if (success && data) {
GMarkupParseContext *context;
ParserClosure closure;
@@ -535,8 +536,8 @@ mail_autoconfig_lookup_uri_sync (EMailAutoconfig *autoconfig,
success = g_markup_parse_context_parse (
context,
- soup_message->response_body->data,
- soup_message->response_body->length,
+ g_bytes_get_data (data, NULL),
+ g_bytes_get_size (data),
error);
if (success)
@@ -546,6 +547,9 @@ mail_autoconfig_lookup_uri_sync (EMailAutoconfig *autoconfig,
g_clear_pointer (&closure.current_type, g_free);
g_markup_parse_context_free (context);
+ } else if (local_error) {
+ g_propagate_error (error, local_error);
+ local_error = NULL;
} else {
g_set_error_literal (
error, E_SOUP_SESSION_ERROR,
@@ -553,7 +557,10 @@ mail_autoconfig_lookup_uri_sync (EMailAutoconfig *autoconfig,
soup_message_get_reason_phrase (soup_message));
}
+ if (data)
+ g_bytes_unref (data);
g_object_unref (soup_message);
+ g_clear_error (&local_error);
return success;
}
@@ -576,8 +583,8 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig,
proxy_source = e_source_registry_ref_builtin_proxy (registry);
soup_session = soup_session_new_with_options (
- SOUP_SESSION_PROXY_RESOLVER, G_PROXY_RESOLVER (proxy_source),
- SOUP_SESSION_TIMEOUT, 15,
+ "proxy-resolver", G_PROXY_RESOLVER (proxy_source),
+ "timeout", 15,
NULL);
g_object_unref (proxy_source);
diff --git a/src/mail/e-mail-display.c b/src/mail/e-mail-display.c
index 61506e7549..baf3e5f8ce 100644
--- a/src/mail/e-mail-display.c
+++ b/src/mail/e-mail-display.c
@@ -1897,7 +1897,7 @@ mail_display_suggest_filename (EWebView *web_view,
{
EMailDisplay *display;
CamelMimePart *mime_part;
- SoupURI *suri;
+ GUri *guri;
/* Note, this assumes the URI comes
* from the currently loaded message. */
@@ -1909,13 +1909,13 @@ mail_display_suggest_filename (EWebView *web_view,
return g_strdup (camel_mime_part_get_filename (mime_part));
guri = g_uri_parse (uri, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (suri) {
+ if (guri) {
gchar *filename = NULL;
- if (suri->query) {
+ if (g_uri_get_query (guri)) {
GHashTable *uri_query;
- uri_query = soup_form_decode (suri->query);
+ uri_query = soup_form_decode (g_uri_get_query (guri));
if (uri_query && g_hash_table_contains (uri_query, "filename"))
filename = g_strdup (g_hash_table_lookup (uri_query, "filename"));
diff --git a/src/modules/book-config-carddav/evolution-book-config-carddav.c
b/src/modules/book-config-carddav/evolution-book-config-carddav.c
index e613303e45..cc69f32bc7 100644
--- a/src/modules/book-config-carddav/evolution-book-config-carddav.c
+++ b/src/modules/book-config-carddav/evolution-book-config-carddav.c
@@ -124,7 +124,7 @@ book_config_carddav_run_dialog (GtkButton *button,
g_uri_unref (guri);
guri = g_uri_parse (href, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (uri) {
+ if (guri) {
ESourceAddressBook *addressbook_extension;
addressbook_extension = e_source_get_extension (context->scratch_source,
E_SOURCE_EXTENSION_ADDRESS_BOOK);
diff --git a/src/modules/book-config-google/e-google-book-chooser-button.c
b/src/modules/book-config-google/e-google-book-chooser-button.c
index ad901050e2..e3bb2f471c 100644
--- a/src/modules/book-config-google/e-google-book-chooser-button.c
+++ b/src/modules/book-config-google/e-google-book-chooser-button.c
@@ -231,7 +231,7 @@ google_book_chooser_button_clicked (GtkButton *btn)
g_uri_unref (guri);
guri = g_uri_parse (href, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (uri) {
+ if (guri) {
ESourceAddressBook *addressbook_extension;
addressbook_extension = e_source_get_extension (button->priv->source,
E_SOURCE_EXTENSION_ADDRESS_BOOK);
diff --git a/src/modules/cal-config-caldav/evolution-cal-config-caldav.c
b/src/modules/cal-config-caldav/evolution-cal-config-caldav.c
index df310c5535..1677956780 100644
--- a/src/modules/cal-config-caldav/evolution-cal-config-caldav.c
+++ b/src/modules/cal-config-caldav/evolution-cal-config-caldav.c
@@ -155,7 +155,7 @@ cal_config_caldav_run_dialog (GtkButton *button,
g_uri_unref (guri);
guri = g_uri_parse (href, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (uri) {
+ if (guri) {
ESourceSelectable *selectable_extension;
const gchar *extension_name;
diff --git a/src/modules/cal-config-google/e-google-chooser-button.c
b/src/modules/cal-config-google/e-google-chooser-button.c
index 2ee89dd7b3..0a0c408609 100644
--- a/src/modules/cal-config-google/e-google-chooser-button.c
+++ b/src/modules/cal-config-google/e-google-chooser-button.c
@@ -266,7 +266,7 @@ google_chooser_button_clicked (GtkButton *button)
g_uri_unref (guri);
guri = g_uri_parse (href, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (uri) {
+ if (guri) {
ESourceSelectable *selectable_extension;
const gchar *extension_name;
diff --git a/src/modules/cal-config-webdav-notes/evolution-cal-config-webdav-notes.c
b/src/modules/cal-config-webdav-notes/evolution-cal-config-webdav-notes.c
index dbb5afa2e3..76846786af 100644
--- a/src/modules/cal-config-webdav-notes/evolution-cal-config-webdav-notes.c
+++ b/src/modules/cal-config-webdav-notes/evolution-cal-config-webdav-notes.c
@@ -141,7 +141,7 @@ cal_config_webdav_notes_run_dialog (GtkButton *button,
g_uri_unref (guri);
guri = g_uri_parse (href, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
- if (uri) {
+ if (guri) {
ESourceSelectable *selectable_extension;
const gchar *extension_name;
diff --git a/src/modules/calendar/e-cal-base-shell-backend.c b/src/modules/calendar/e-cal-base-shell-backend.c
index f93c02cbb8..43395fc9a2 100644
--- a/src/modules/calendar/e-cal-base-shell-backend.c
+++ b/src/modules/calendar/e-cal-base-shell-backend.c
@@ -110,8 +110,8 @@ cal_base_shell_backend_handle_webcal_uri (EShellBackend *shell_backend,
if (!guri) {
/* Just a fallback when the passed-in URI is invalid,
to have set something in the UI. */
- guri = g_uri_build ("https", NULL, NULL, -1, uri, NULL, NULL);
- } else if (g_strcmp0 (g_uri_get_scheme (guri, "https") != 0) {
+ guri = g_uri_build (G_URI_FLAGS_NONE, "https", NULL, NULL, -1, uri,
NULL, NULL);
+ } else if (g_strcmp0 (g_uri_get_scheme (guri), "https") != 0) {
/* https everywhere */
e_util_change_uri_component (&guri, SOUP_URI_SCHEME, "https");
}
diff --git a/src/modules/gravatar/e-gravatar-photo-source.c b/src/modules/gravatar/e-gravatar-photo-source.c
index cd27998f9f..6f5d09bfd8 100644
--- a/src/modules/gravatar/e-gravatar-photo-source.c
+++ b/src/modules/gravatar/e-gravatar-photo-source.c
@@ -71,7 +71,7 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple,
GCancellable *cancellable)
{
AsyncContext *async_context;
- SoupRequest *request;
+ SoupMessage *message;
SoupSession *session;
GInputStream *stream = NULL;
gchar *hash;
@@ -94,10 +94,10 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple,
session = soup_session_new ();
/* We control the URI so there should be no error. */
- request = soup_session_request (session, uri, NULL);
- g_return_if_fail (request != NULL);
+ message = soup_message_new (SOUP_METHOD_GET, uri);
+ g_return_if_fail (message != NULL);
- stream = soup_request_send (request, cancellable, &local_error);
+ stream = soup_session_send (session, message, cancellable, &local_error);
/* Sanity check. */
g_return_if_fail (
@@ -108,11 +108,6 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple,
* We need to check the status code on the SoupMessage
* to make sure the we're not getting an error message. */
if (stream != NULL) {
- SoupMessage *message;
-
- message = soup_request_http_get_message (
- SOUP_REQUEST_HTTP (request));
-
if (SOUP_STATUS_IS_SUCCESSFUL (soup_message_get_status (message))) {
async_context->stream = g_object_ref (stream);
@@ -123,7 +118,6 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple,
soup_message_get_reason_phrase (message));
}
- g_object_unref (message);
g_object_unref (stream);
}
@@ -137,7 +131,7 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple,
g_debug ("Request complete");
- g_clear_object (&request);
+ g_clear_object (&message);
g_clear_object (&session);
g_free (hash);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]