Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package evolution-ews for openSUSE:Factory checked in at 2022-01-09 22:50:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/evolution-ews (Old) and /work/SRC/openSUSE:Factory/.evolution-ews.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "evolution-ews" Sun Jan 9 22:50:05 2022 rev:120 rq:944805 version:3.42.3 Changes: -------- --- /work/SRC/openSUSE:Factory/evolution-ews/evolution-ews.changes 2021-11-06 18:17:20.760863284 +0100 +++ /work/SRC/openSUSE:Factory/.evolution-ews.new.1892/evolution-ews.changes 2022-01-09 22:50:20.923293392 +0100 @@ -1,0 +2,7 @@ +Fri Jan 7 16:38:19 UTC 2022 - Bj??rn Lie <bjorn....@gmail.com> + +- Update to version 3.42.3: + + Misc: Hide some headers' value in EWS_DEBUG=2 output. + + Bugs fixed: glgo#GNOME/evolution-ews#174. + +------------------------------------------------------------------- @@ -7 +14 @@ - + Bugs fixed: glgo#GNOME/evolution-ews3, + + Bugs fixed: glgo#GNOME/evolution-ews#3, Old: ---- evolution-ews-3.42.1.tar.xz New: ---- evolution-ews-3.42.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ evolution-ews.spec ++++++ --- /var/tmp/diff_new_pack.cxv8lv/_old 2022-01-09 22:50:21.399293817 +0100 +++ /var/tmp/diff_new_pack.cxv8lv/_new 2022-01-09 22:50:21.403293821 +0100 @@ -1,7 +1,7 @@ # # spec file for package evolution-ews # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %define _version %(echo %{version} | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+') Name: evolution-ews -Version: 3.42.1 +Version: 3.42.3 Release: 0 Summary: Exchange Connector for Evolution, compatible with Exchange 2007 and later License: LGPL-2.1-only ++++++ evolution-ews-3.42.1.tar.xz -> evolution-ews-3.42.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/CMakeLists.txt new/evolution-ews-3.42.3/CMakeLists.txt --- old/evolution-ews-3.42.1/CMakeLists.txt 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/CMakeLists.txt 2022-01-07 11:49:13.000000000 +0100 @@ -4,7 +4,7 @@ cmake_policy(VERSION 3.1) project(evolution-ews - VERSION 3.42.1 + VERSION 3.42.3 LANGUAGES C) set(PROJECT_BUGREPORT "https://gitlab.gnome.org/GNOME/evolution-ews/issues/") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/NEWS new/evolution-ews-3.42.3/NEWS --- old/evolution-ews-3.42.1/NEWS 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/NEWS 2022-01-07 11:49:13.000000000 +0100 @@ -1,3 +1,12 @@ +Evolution-EWS 3.42.3 2022-01-07 +------------------------------- + +Bug Fixes: + I#174 - Silently retry on I/O errors (like 'Connection terminated unexpectedly') + +Miscellaneous: + Misc: Hide some headers' value in EWS_DEBUG=2 output + Evolution-EWS 3.42.1 2021-10-29 ------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-ews-connection-utils.c new/evolution-ews-3.42.3/src/EWS/common/e-ews-connection-utils.c --- old/evolution-ews-3.42.1/src/EWS/common/e-ews-connection-utils.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-ews-connection-utils.c 2022-01-07 11:49:13.000000000 +0100 @@ -463,7 +463,7 @@ ews_connection_utils_setup_bearer_auth (cnc, session, msg, TRUE, E_SOUP_AUTH_BEARER (auth), NULL, &local_error); if (local_error) - soup_message_set_status_full (msg, SOUP_STATUS_IO_ERROR, local_error->message); + soup_message_set_status_full (msg, SOUP_STATUS_MALFORMED, local_error->message); g_object_unref (using_bearer_auth); g_clear_error (&local_error); @@ -477,7 +477,7 @@ e_ews_connection_utils_expired_password_to_error (service_url, &local_error); if (local_error) - soup_message_set_status_full (msg, SOUP_STATUS_IO_ERROR, local_error->message); + soup_message_set_status_full (msg, SOUP_STATUS_MALFORMED, local_error->message); g_clear_error (&local_error); g_free (service_url); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-ews-connection.c new/evolution-ews-3.42.3/src/EWS/common/e-ews-connection.c --- old/evolution-ews-3.42.1/src/EWS/common/e-ews-connection.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-ews-connection.c 2022-01-07 11:49:13.000000000 +0100 @@ -30,6 +30,8 @@ #define d(x) x +#define EWS_RETRY_IO_ERROR_SECONDS 3 + /* A chunk size limit when moving items in chunks. */ #define EWS_MOVE_ITEMS_CHUNK_SIZE 500 @@ -153,6 +155,8 @@ GCancellable *cancellable; gulong cancel_handler_id; + + gboolean retrying_after_network_error; }; struct _EwsUrls { @@ -922,7 +926,7 @@ gpointer data) { EwsNode *enode = (EwsNode *) data; - ESoapResponse *response; + ESoapResponse *response = NULL; ESoapParameter *param; const gchar *persistent_auth; gint log_level; @@ -978,6 +982,11 @@ EWS_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Authentication failed")); goto exit; + } else if (!enode->retrying_after_network_error && + msg->status_code == SOUP_STATUS_IO_ERROR) { + wait_ms = EWS_RETRY_IO_ERROR_SECONDS * 1000; + enode->retrying_after_network_error = TRUE; + goto retrylbl; } else if (msg->status_code == SOUP_STATUS_CANT_RESOLVE || msg->status_code == SOUP_STATUS_CANT_RESOLVE_PROXY || msg->status_code == SOUP_STATUS_CANT_CONNECT || @@ -1006,7 +1015,7 @@ * Logging framework also */ log_level = e_ews_debug_get_log_level (); - if (log_level >= 1 && log_level < 3) { + if (log_level == 1) { /* This will dump only the headers, since we stole the body. * And only if EWS_DEBUG=1, since higher levels will have dumped * it directly from libsoup anyway. */ @@ -1015,7 +1024,10 @@ e_soap_response_dump_response (response, stdout); } - param = e_soap_response_get_first_parameter_by_name (response, "detail", NULL); + if (!wait_ms && e_ews_connection_get_backoff_enabled (enode->cnc)) + param = e_soap_response_get_first_parameter_by_name (response, "detail", NULL); + else + param = NULL; if (param) param = e_soap_parameter_get_first_child_by_name (param, "ResponseCode"); if (param) { @@ -1042,7 +1054,8 @@ g_free (value); } - if (wait_ms > 0 && e_ews_connection_get_backoff_enabled (enode->cnc)) { + retrylbl: + if (wait_ms > 0) { GCancellable *cancellable = enode->cancellable; EFlag *flag; @@ -1086,7 +1099,7 @@ e_flag_free (flag); - g_object_unref (response); + g_clear_object (&response); if (g_cancellable_is_cancelled (cancellable) || msg->status_code == SOUP_STATUS_CANCELLED) { @@ -1101,6 +1114,7 @@ new_node->cb = enode->cb; new_node->cnc = enode->cnc; new_node->simple = enode->simple; + new_node->retrying_after_network_error = enode->retrying_after_network_error; enode->simple = NULL; @@ -1123,7 +1137,7 @@ if (enode->cb != NULL) enode->cb (response, enode->simple); - g_object_unref (response); + g_clear_object (&response); exit: if (enode->simple) @@ -1818,7 +1832,7 @@ const gchar *message, gpointer user_data) { - if (e_ews_debug_get_log_level () >= 3) + if (e_ews_debug_get_log_level () >= 4) g_log_default_handler (log_domain, log_level, message, NULL); } @@ -1835,20 +1849,7 @@ const gchar *data, gpointer user_data) { - const gchar *filtered_data = NULL; - - if (e_ews_debug_get_log_level () >= 3) { - if (direction == '>' && g_ascii_strncasecmp (data, "Host:", 5) == 0) - filtered_data = "Host: <redacted>"; - else if (direction == '>' && g_ascii_strncasecmp (data, "Authorization:", 14) == 0) - filtered_data = "Authorization: <redacted>"; - else if (direction == '<' && g_ascii_strncasecmp (data, "Set-Cookie:", 11) == 0) - filtered_data = "Set-Cookie: <redacted>"; - else - filtered_data = data; - } - - g_debug ("%c %s", direction, filtered_data ? filtered_data : data); + g_debug ("%c %s", direction, e_ews_debug_redact_headers (direction, data)); } static void @@ -1998,13 +1999,15 @@ SoupLogger *logger; logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1); - if (log_level >= 3) { + if (log_level >= 4) { soup_logger_set_printer (logger, e_ews_soup_log_printer, NULL, NULL); g_log_set_handler ( G_LOG_DOMAIN, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO, e_ews_debug_handler, cnc); + } else if (log_level == 2) { + soup_logger_set_printer (logger, e_ews_debug_soup_log_printer_stdout, NULL, NULL); } soup_session_add_feature ( @@ -4556,7 +4559,7 @@ * Don't use streaming-based messages when we are loggin the traffic * to generate trace files for tests */ - if (e_ews_debug_get_log_level () <= 2) + if (e_ews_debug_get_log_level () <= 3) soup_message_body_set_accumulate (soup_message->response_body, FALSE); g_signal_connect ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-ews-debug.c new/evolution-ews-3.42.3/src/EWS/common/e-ews-debug.c --- old/evolution-ews-3.42.1/src/EWS/common/e-ews-debug.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-ews-debug.c 2022-01-07 11:49:13.000000000 +0100 @@ -137,3 +137,34 @@ msg->response_body); } } + +const gchar * +e_ews_debug_redact_headers (gchar direction, + const gchar *data) +{ + const gchar *filtered_data = NULL; + gint log_level = e_ews_debug_get_log_level (); + + if (log_level == 2 || log_level > 3) { + if (direction == '>' && g_ascii_strncasecmp (data, "Host:", 5) == 0) + filtered_data = "Host: <redacted>"; + else if (direction == '>' && g_ascii_strncasecmp (data, "Authorization:", 14) == 0) + filtered_data = "Authorization: <redacted>"; + else if (direction == '<' && g_ascii_strncasecmp (data, "Set-Cookie:", 11) == 0) + filtered_data = "Set-Cookie: <redacted>"; + else if (direction == '>' && g_ascii_strncasecmp (data, "Cookie:", 7) == 0) + filtered_data = "Cookie: <redacted>"; + } + + return filtered_data ? filtered_data : data; +} + +void +e_ews_debug_soup_log_printer_stdout (SoupLogger *logger, + SoupLoggerLogLevel level, + char direction, + const gchar *data, + gpointer user_data) +{ + g_print ("%c %s\n", direction, e_ews_debug_redact_headers (direction, data)); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-ews-debug.h new/evolution-ews-3.42.3/src/EWS/common/e-ews-debug.h --- old/evolution-ews-3.42.1/src/EWS/common/e-ews-debug.h 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-ews-debug.h 2022-01-07 11:49:13.000000000 +0100 @@ -22,6 +22,13 @@ (SoupMessage *msg); void e_ews_debug_dump_raw_soup_response (SoupMessage *msg); +const gchar * e_ews_debug_redact_headers (gchar direction, + const gchar *data); +void e_ews_debug_soup_log_printer_stdout (SoupLogger *logger, + SoupLoggerLogLevel level, + char direction, + const gchar *data, + gpointer user_data); G_END_DECLS #endif /* E_EWS_DEBUG_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-ews-notification.c new/evolution-ews-3.42.3/src/EWS/common/e-ews-notification.c --- old/evolution-ews-3.42.1/src/EWS/common/e-ews-notification.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-ews-notification.c 2022-01-07 11:49:13.000000000 +0100 @@ -258,6 +258,9 @@ SoupLogger *logger; logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1); + if (log_level == 2) + soup_logger_set_printer (logger, e_ews_debug_soup_log_printer_stdout, NULL, NULL); + soup_session_add_feature (notification->priv->soup_session, SOUP_SESSION_FEATURE (logger)); g_object_unref (logger); } @@ -356,7 +359,7 @@ return FALSE; } - if (log_level >= 1 && log_level < 3) { + if (log_level >= 1 && log_level != 2 && log_level < 4) { e_ews_debug_dump_raw_soup_request (SOUP_MESSAGE (msg)); } @@ -380,7 +383,7 @@ response = e_soap_response_new_from_xmldoc (doc); - if (log_level >= 1 && log_level < 3) { + if (log_level >= 1 && log_level != 2 && log_level < 4) { e_ews_debug_dump_raw_soup_response (SOUP_MESSAGE (msg)); } g_object_unref (msg); @@ -740,7 +743,7 @@ if (response == NULL) break; - if (log_level >= 1 && log_level < 3) { + if (log_level >= 1 && log_level != 2 && log_level < 4) { e_ews_debug_dump_raw_soup_response (msg); e_soap_response_dump_response (response, stdout); } @@ -871,19 +874,19 @@ e_ews_message_write_footer (msg); /* Complete the footer and print the request */ - if (e_ews_debug_get_log_level () <= 2) + if (e_ews_debug_get_log_level () <= 3) soup_message_body_set_accumulate (SOUP_MESSAGE (msg)->response_body, FALSE); - handler_id = g_signal_connect ( - SOUP_MESSAGE (msg), "got-chunk", - G_CALLBACK (ews_notification_soup_got_chunk), notification); - if (!e_ews_connection_utils_prepare_message (cnc, notification->priv->soup_session, SOUP_MESSAGE (msg), notification->priv->cancellable)) { g_object_unref (msg); g_object_unref (cnc); return FALSE; } + handler_id = g_signal_connect ( + SOUP_MESSAGE (msg), "got-chunk", + G_CALLBACK (ews_notification_soup_got_chunk), notification); + /* Unref it early, thus it doesn't keep the connection alive after all backends are freed */ g_object_unref (cnc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-soap-message.c new/evolution-ews-3.42.3/src/EWS/common/e-soap-message.c --- old/evolution-ews-3.42.1/src/EWS/common/e-soap-message.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-soap-message.c 2022-01-07 11:49:13.000000000 +0100 @@ -330,7 +330,7 @@ * Don't use streaming-based messages when we are loggin the traffic * to generate trace files for tests */ - if (e_ews_debug_get_log_level () <= 2) { + if (e_ews_debug_get_log_level () <= 3) { /* Don't accumulate body data into a huge buffer. * Instead, parse it as it arrives. */ soup_message_body_set_accumulate ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/EWS/common/e-soap-response.c new/evolution-ews-3.42.3/src/EWS/common/e-soap-response.c --- old/evolution-ews-3.42.1/src/EWS/common/e-soap-response.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/EWS/common/e-soap-response.c 2022-01-07 11:49:13.000000000 +0100 @@ -562,7 +562,7 @@ g_set_error ( error, - SOUP_HTTP_ERROR, SOUP_STATUS_IO_ERROR, + SOUP_HTTP_ERROR, SOUP_STATUS_MALFORMED, "%s", (string != NULL) ? string : "<faultstring> in SOAP response"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/src/Microsoft365/common/e-m365-connection.c new/evolution-ews-3.42.3/src/Microsoft365/common/e-m365-connection.c --- old/evolution-ews-3.42.1/src/Microsoft365/common/e-m365-connection.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/src/Microsoft365/common/e-m365-connection.c 2022-01-07 11:49:13.000000000 +0100 @@ -19,6 +19,7 @@ #define LOCK(x) g_rec_mutex_lock (&(x->priv->property_lock)) #define UNLOCK(x) g_rec_mutex_unlock (&(x->priv->property_lock)) +#define M365_RETRY_IO_ERROR_SECONDS 3 #define X_EVO_M365_DATA "X-EVO-M365-DATA" typedef enum _CSMFlags { @@ -274,7 +275,7 @@ m365_connection_utils_setup_bearer_auth (cnc, session, msg, TRUE, E_SOUP_AUTH_BEARER (auth), NULL, &local_error); if (local_error) - soup_message_set_status_full (msg, SOUP_STATUS_IO_ERROR, local_error->message); + soup_message_set_status_full (msg, SOUP_STATUS_MALFORMED, local_error->message); g_object_unref (using_bearer_auth); g_clear_error (&local_error); @@ -1139,6 +1140,7 @@ SoupSession *soup_session; gint need_retry_seconds = 5; gboolean success = FALSE, need_retry = TRUE; + gboolean did_io_error_retry = FALSE; g_return_val_if_fail (E_IS_M365_CONNECTION (cnc), FALSE); g_return_val_if_fail (SOUP_IS_MESSAGE (message), FALSE); @@ -1237,10 +1239,12 @@ if (success && m365_log_enabled ()) input_stream = e_soup_logger_attach (message, input_stream); - /* Throttling - https://docs.microsoft.com/en-us/graph/throttling */ - if (message->status_code == 429 || + if ((!did_io_error_retry && message->status_code == SOUP_STATUS_IO_ERROR) || + /* Throttling - https://docs.microsoft.com/en-us/graph/throttling */ + message->status_code == 429 || /* https://docs.microsoft.com/en-us/graph/best-practices-concept#handling-expected-errors */ message->status_code == SOUP_STATUS_SERVICE_UNAVAILABLE) { + did_io_error_retry = did_io_error_retry || message->status_code == SOUP_STATUS_IO_ERROR; need_retry = TRUE; } else if (message->status_code == SOUP_STATUS_SSL_FAILED) { m365_connection_extract_ssl_data (cnc, message); @@ -1254,6 +1258,8 @@ if (retry_after_str && *retry_after_str) retry_after = g_ascii_strtoll (retry_after_str, NULL, 10); + else if (message->status_code == SOUP_STATUS_IO_ERROR) + retry_after = M365_RETRY_IO_ERROR_SECONDS; else retry_after = 0; @@ -1968,7 +1974,7 @@ if (!submessage) continue; - submessage->status_code = SOUP_STATUS_IO_ERROR; + submessage->status_code = SOUP_STATUS_MALFORMED; suri = soup_message_get_uri (submessage); uri = suri ? soup_uri_to_string (suri, TRUE) : NULL; @@ -2086,6 +2092,7 @@ GPtrArray *use_requests; gint need_retry_seconds = 5; gboolean success, need_retry = TRUE; + gboolean did_io_error_retry = FALSE; g_return_val_if_fail (E_IS_M365_CONNECTION (cnc), FALSE); g_return_val_if_fail (requests != NULL, FALSE); @@ -2110,13 +2117,15 @@ if (!message) continue; - /* Throttling - https://docs.microsoft.com/en-us/graph/throttling */ - if (message->status_code == 429 || + if ((!did_io_error_retry && message->status_code == SOUP_STATUS_IO_ERROR) || + /* Throttling - https://docs.microsoft.com/en-us/graph/throttling */ + message->status_code == 429 || /* https://docs.microsoft.com/en-us/graph/best-practices-concept#handling-expected-errors */ message->status_code == SOUP_STATUS_SERVICE_UNAVAILABLE) { const gchar *retry_after_str; gint64 retry_after; + did_io_error_retry = did_io_error_retry || message->status_code == SOUP_STATUS_IO_ERROR; need_retry = TRUE; if (!new_requests) @@ -2128,6 +2137,8 @@ if (retry_after_str && *retry_after_str) retry_after = g_ascii_strtoll (retry_after_str, NULL, 10); + else if (message->status_code == SOUP_STATUS_IO_ERROR) + retry_after = M365_RETRY_IO_ERROR_SECONDS; else retry_after = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/evolution-ews-3.42.1/tests/ews-test-common.c new/evolution-ews-3.42.3/tests/ews-test-common.c --- old/evolution-ews-3.42.1/tests/ews-test-common.c 2021-10-29 09:48:02.000000000 +0200 +++ new/evolution-ews-3.42.3/tests/ews-test-common.c 2022-01-07 11:49:13.000000000 +0100 @@ -211,7 +211,7 @@ g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugzilla.gnome.org/show_bug.cgi?id="); - g_setenv ("EWS_DEBUG", "3", TRUE); + g_setenv ("EWS_DEBUG", "4", TRUE); g_setenv ("EWS_INTERNAL_TEST", "1", TRUE); mock_server = uhm_server_new ();