From 51f081335faf0609b65e284a48d4b5513a72a04d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 10 Jun 2004 02:13:24 +0000 Subject: move the stream based checking into the loop, after we connect. Fixes a 2004-06-10 Not Zed * providers/nntp/camel-nntp-store.c (camel_nntp_command): move the stream based checking into the loop, after we connect. Fixes a crash. svn path=/trunk/; revision=26272 --- camel/providers/nntp/camel-nntp-store.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 515c927f3c..d46ddeb93b 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -1262,14 +1262,6 @@ camel_nntp_command (CamelNNTPStore *store, CamelException *ex, CamelNNTPFolder * _("Not connected.")); return -1; } - - /* Check for unprocessed data, ! */ - if (store->stream->mode == CAMEL_NNTP_STREAM_DATA) { - g_warning("Unprocessed data left in stream, flushing"); - while (camel_nntp_stream_getd(store->stream, (unsigned char **)&p, &u) > 0) - ; - } - camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_LINE); retry = 0; do { @@ -1279,6 +1271,14 @@ camel_nntp_command (CamelNNTPStore *store, CamelException *ex, CamelNNTPFolder * && !camel_service_connect (CAMEL_SERVICE (store), ex)) return -1; + /* Check for unprocessed data, ! */ + if (store->stream->mode == CAMEL_NNTP_STREAM_DATA) { + g_warning("Unprocessed data left in stream, flushing"); + while (camel_nntp_stream_getd(store->stream, (unsigned char **)&p, &u) > 0) + ; + } + camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_LINE); + if (folder != NULL && (store->current_folder == NULL || strcmp(store->current_folder, ((CamelFolder *)folder)->full_name) != 0)) { ret = camel_nntp_raw_command(store, ex, line, "group %s", ((CamelFolder *)folder)->full_name); -- cgit v1.2.3