aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/nntp/camel-nntp-folder.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-19 15:06:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-19 15:06:10 +0800
commitd15cdfc929687f1c37939e78a08c30e4e4b636de (patch)
tree004f4759e1a11cb682f705402aa4987f5c9a7521 /camel/providers/nntp/camel-nntp-folder.c
parentdbd786a2dded4808518c91cb2414d173e50f5aa9 (diff)
downloadgsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.tar
gsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.tar.gz
gsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.tar.bz2
gsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.tar.lz
gsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.tar.xz
gsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.tar.zst
gsoc2013-evolution-d15cdfc929687f1c37939e78a08c30e4e4b636de.zip
use the article number instead of the messageid. Some servers are just
2004-05-19 Not Zed <NotZed@Ximian.com> * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message): use the article number instead of the messageid. Some servers are just broken. (nntp_folder_cache_message): same. See #58655. * camel-smime-context.c (sm_verify_cmsg): import the certs as UsageEmailRecipient as well as signer, and also save the certs always. svn path=/trunk/; revision=25975
Diffstat (limited to 'camel/providers/nntp/camel-nntp-folder.c')
-rw-r--r--camel/providers/nntp/camel-nntp-folder.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 4762cf974a..3c8b248a7b 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -178,18 +178,21 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder, const char *uid, Came
{
CamelNNTPStore *nntp_store = (CamelNNTPStore *)((CamelFolder *) disco_folder)->parent_store;
CamelStream *stream;
- const char *msgid;
-
- if (!(msgid = strchr (uid, ','))) {
+ char *article, *msgid;
+
+ article = alloca(strlen(uid)+1);
+ strcpy(article, uid);
+ msgid = strchr(uid, ',');
+ if (!msgid) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Internal error: uid in invalid format: %s"), uid);
return;
}
- msgid++;
+ *msgid++ = 0;
CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
- stream = nntp_folder_download_message ((CamelNNTPFolder *) disco_folder, msgid, ex);
+ stream = nntp_folder_download_message ((CamelNNTPFolder *) disco_folder, article, ex);
if (stream) {
camel_object_unref (stream);
} else {
@@ -210,20 +213,22 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
CamelNNTPFolder *nntp_folder;
CamelStream *stream = NULL;
char *line = NULL;
- const char *msgid;
-
+ char *article, *msgid;
+
nntp_store = (CamelNNTPStore *) folder->parent_store;
nntp_folder = (CamelNNTPFolder *) folder;
CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
+
+ article = alloca(strlen(uid)+1);
+ strcpy(article, uid);
msgid = strchr (uid, ',');
if (msgid == NULL) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Internal error: uid in invalid format: %s"), uid);
goto fail;
}
- msgid++;
+ *msgid++ = 0;
/* Lookup in cache, NEWS is global messageid's so use a global cache path */
stream = camel_data_cache_get (nntp_store->cache, "cache", msgid, NULL);
@@ -233,8 +238,8 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
_("This message is not currently available"));
goto fail;
}
-
- stream = nntp_folder_download_message (nntp_folder, msgid, ex);
+
+ stream = nntp_folder_download_message (nntp_folder, article, ex);
if (stream == NULL)
goto fail;
}