Hello community, here is the log from the commit of package evolution-data-server for openSUSE:11.4 checked in at Thu Mar 17 14:30:44 CET 2011. -------- --- old-versions/11.4/all/evolution-data-server/evolution-data-server.changes 2010-11-16 11:49:56.000000000 +0100 +++ 11.4/evolution-data-server/evolution-data-server.changes 2011-03-12 07:12:15.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Mar 11 19:36:04 UTC 2011 - malcolmlewis@opensuse.org + +- Fix bug bnc#678934 malcolmlewis@opensuse.org -- Check NNTP + server capabilities before using OVER command + +------------------------------------------------------------------- Package does not exist at destination yet. Using Fallback old-versions/11.4/all/evolution-data-server Destination is old-versions/11.4/UPDATES/all/evolution-data-server calling whatdependson for 11.4-i586 New: ---- fix-for-nntp-over-command.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ evolution-data-server.spec ++++++ --- /var/tmp/diff_new_pack.Gex5ok/_old 2011-03-17 14:28:48.000000000 +0100 +++ /var/tmp/diff_new_pack.Gex5ok/_new 2011-03-17 14:28:48.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package evolution-data-server (Version 2.32.1) +# spec file for package evolution-data-server # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -66,13 +66,15 @@ Obsoletes: evolution-data-server-32bit %endif Version: 2.32.1 -Release: 1 +Release: 4.<RELEASE2> Summary: Evolution Data Server Url: http://www.gnome.org Source0: ftp://ftp.gnome.org/pub/gnome/sources/evolution-data-server/2.25/%{name}-%{version}.tar.bz2 Source99: baselibs.conf # PATCH-FEATURE-OPENSUSE dice-eds-changes.patch pchenthill@novell.com -- Patch yet to be pushed upstream Patch0: dice-eds-changes.patch +# PATCH-FIX-OPENSUSE fix-for-nntp-over-command.patch bnc#678934 malcolmlewis@opensuse.org -- Check NNTP server capabilities before using OVER command +Patch1: fix-for-nntp-over-command.patch Requires: libsoup >= 2.2.6 Requires: mozilla-nss Recommends: %{name}-lang = %{version} @@ -237,6 +239,7 @@ %setup -q translation-update-upstream %patch0 -p1 +%patch1 -p1 %build %{configure} \ ++++++ fix-for-nntp-over-command.patch ++++++ diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 943368d..a92e60e 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -129,6 +129,37 @@ nntp_can_work_offline(CamelDiscoStore *store) return TRUE; } +static gint +check_capabilities (CamelNNTPStore *store, GError **error) +{ + gint ret; + gchar *line; + guint len; + + store->capabilities = 0; + + ret = camel_nntp_raw_command_auth (store, error, &line, "CAPABILITIES"); + if (ret != 101) + return -1; + + while ((ret = camel_nntp_stream_line (store->stream, (guchar **) &line, &len, error)) > 0) { + while (len > 0 && g_ascii_isspace (*line)) { + line++; + len--; + } + + if (len == 4 && g_ascii_strncasecmp (line, "OVER", len) == 0) + store->capabilities |= NNTP_CAPABILITY_OVER; + + if (len == 1 && g_ascii_strncasecmp (line, ".", len) == 0) { + ret = 0; + break; + } + } + + return ret; +} + static struct { const gchar *name; gint type; @@ -330,10 +361,12 @@ static struct { static gboolean nntp_connect_online (CamelService *service, GError **error) { + CamelNNTPStore *store = CAMEL_NNTP_STORE (service); const gchar *ssl_mode; gint mode, i; gchar *serv; gint fallback_port; + GError *local_error = NULL; if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) { for (i = 0; ssl_options[i].value; i++) @@ -354,6 +387,30 @@ nntp_connect_online (CamelService *service, GError **error) fallback_port = 0; } + if (!connect_to_server ( + service, service->url->host, serv, + fallback_port, mode, error)) + return FALSE; + + if (check_capabilities (store, &local_error) != -1) + return TRUE; + + if (local_error) + g_error_free (local_error); + + store->capabilities = 0; + + /* disconnect and reconnect without capability check */ + camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); + + if (store->stream) + g_object_unref (store->stream); + store->stream = NULL; + g_free (store->current_folder); + store->current_folder = NULL; + + camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK); + return connect_to_server (service, service->url->host, serv, fallback_port, mode, error); } diff --git a/camel/providers/nntp/camel-nntp-store.h b/camel/providers/nntp/camel-nntp-store.h index 3f0de8d..bbfa6de 100644 --- a/camel/providers/nntp/camel-nntp-store.h +++ b/camel/providers/nntp/camel-nntp-store.h @@ -78,6 +78,11 @@ struct _xover_header { xover_t type:8; }; +/* names of supported capabilities on the server */ +enum nntp_capabilities { + NNTP_CAPABILITY_OVER = (1 << 0) /* supports OVER command */ +}; + struct _CamelNNTPStore { CamelDiscoStore parent; @@ -100,6 +105,7 @@ struct _CamelNNTPStore { gchar *current_folder, *storage_path, *base_url; struct _xover_header *xover; + guint32 capabilities; /* bit-or of nntp_capabilities */ }; struct _CamelNNTPStoreClass { diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c index 815a42e..f0dfab1 100644 --- a/camel/providers/nntp/camel-nntp-summary.c +++ b/camel/providers/nntp/camel-nntp-summary.c @@ -237,10 +237,15 @@ add_range_xover (CamelNNTPSummary *cns, CamelNNTPStore *store, guint high, guint camel_operation_start (NULL, _("%s: Scanning new messages"), ((CamelService *)store)->url->host); - ret = camel_nntp_raw_command_auth (store, error, &line, "over %r", low, high); - if (ret != 224) + if ((store->capabilities & NNTP_CAPABILITY_OVER) != 0) + ret = camel_nntp_raw_command_auth (store, error, &line, "over %r", low, high); + else + ret = -1; + if (ret != 224) { + store->capabilities = store->capabilities & (~NNTP_CAPABILITY_OVER); ret = camel_nntp_raw_command_auth (store, error, &line, "xover %r", low, high); - + } + if (ret != 224) { camel_operation_end (NULL); if (ret != -1) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org