aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-10-05 08:51:58 +0800
committerChris Toshok <toshok@src.gnome.org>2000-10-05 08:51:58 +0800
commitdac3e574bf268991651bedcf2bb0c70d70a5c5dc (patch)
treedeb361be77116d2743f506c6a31e02a6b555a20e
parent2deab9c41716083286a3c74d1ece13214972399c (diff)
downloadgsoc2013-evolution-dac3e574bf268991651bedcf2bb0c70d70a5c5dc.tar.gz
gsoc2013-evolution-dac3e574bf268991651bedcf2bb0c70d70a5c5dc.tar.zst
gsoc2013-evolution-dac3e574bf268991651bedcf2bb0c70d70a5c5dc.zip
revert to old method (only use XOVER if OVER is supported.)
2000-10-04 Chris Toshok <toshok@helixcode.com> * providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers): revert to old method (only use XOVER if OVER is supported.) * providers/nntp/camel-nntp-store.c (camel_nntp_store_get_overview_fmt): handle the case where the OVER extension isn't listed but LIST OVERVIEW.FMT works (again, INN 2.2). enable the OVER extension in this case. svn path=/trunk/; revision=5739
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/providers/nntp/camel-nntp-store.c28
-rw-r--r--camel/providers/nntp/camel-nntp-utils.c10
3 files changed, 34 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 0a286e715b..d6c7baa3a8 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,15 @@
2000-10-04 Chris Toshok <toshok@helixcode.com>
+ * providers/nntp/camel-nntp-utils.c (camel_nntp_get_headers):
+ revert to old method (only use XOVER if OVER is supported.)
+
+ * providers/nntp/camel-nntp-store.c
+ (camel_nntp_store_get_overview_fmt): handle the case where the
+ OVER extension isn't listed but LIST OVERVIEW.FMT works (again,
+ INN 2.2). enable the OVER extension in this case.
+
+2000-10-04 Chris Toshok <toshok@helixcode.com>
+
* providers/nntp/camel-nntp-utils.c (get_XOVER_headers): return a
gboolean so we can tell if this command worked. we can't key off
the OVER extension being present because at least one server (INN
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index b7466f7baf..52ed2d4966 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -120,17 +120,28 @@ camel_nntp_store_get_overview_fmt (CamelNNTPStore *store, CamelException *ex)
int status;
int i;
gboolean done = FALSE;
+
+ g_print ("camel_nntp_store_get_overview_fmt\n");
status = camel_nntp_command (store, ex, NULL,
"LIST OVERVIEW.FMT");
if (status != NNTP_LIST_FOLLOWS) {
- /* if we can't get the overview format, we should
- disable OVER support */
- g_warning ("server reported support of OVER but LIST OVERVIEW.FMT failed."
- " disabling OVER\n");
- store->extensions &= ~CAMEL_NNTP_EXT_OVER;
- return;
+ if (store->extensions & CAMEL_NNTP_EXT_OVER) {
+ /* if we can't get the overview format, we should
+ disable OVER support */
+ g_warning ("server reported support of OVER but LIST OVERVIEW.FMT failed."
+ " disabling OVER.\n");
+ store->extensions &= ~CAMEL_NNTP_EXT_OVER;
+ return;
+ }
+ }
+ else {
+ if (!(store->extensions & CAMEL_NNTP_EXT_OVER)) {
+ g_warning ("server didn't report support of OVER but LIST OVERVIEW.FMT worked."
+ " enabling OVER.\n");
+ store->extensions |= CAMEL_NNTP_EXT_OVER;
+ }
}
/* start at 1 because the article number is always first */
@@ -244,9 +255,8 @@ nntp_store_connect (CamelService *service, CamelException *ex)
/* get a list of extensions that the server supports */
camel_nntp_store_get_extensions (store, ex);
- /* if the server supports the OVER extension, get the overview.fmt */
- if (store->extensions & CAMEL_NNTP_EXT_OVER)
- camel_nntp_store_get_overview_fmt (store, ex);
+ /* try to get the overview.fmt */
+ camel_nntp_store_get_overview_fmt (store, ex);
return TRUE;
}
diff --git a/camel/providers/nntp/camel-nntp-utils.c b/camel/providers/nntp/camel-nntp-utils.c
index b23d2c540d..e8ee9bb112 100644
--- a/camel/providers/nntp/camel-nntp-utils.c
+++ b/camel/providers/nntp/camel-nntp-utils.c
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
-static gboolean
+static void
get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
int first_message, int last_message, CamelException *ex)
{
@@ -107,13 +107,10 @@ get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
}
g_free (line);
}
-
- return TRUE;
}
else {
/* XXX */
g_warning ("weird nntp response for XOVER: %d\n", status);
- return FALSE;
}
}
@@ -240,7 +237,10 @@ camel_nntp_get_headers (CamelStore *store,
}
- if (!get_XOVER_headers (nntp_store, folder, first_message, last_message, ex)) {
+ if (nntp_store->extensions & CAMEL_NNTP_EXT_OVER) {
+ get_XOVER_headers (nntp_store, folder, first_message, last_message, ex);
+ }
+ else {
g_warning ("need to fix get_HEAD_headers\n");
#if 0
get_HEAD_headers (nntp_store, folder, first_message, last_message, ex);