[pan2] Treat a 500 response to MODE READER as OK
- From: Petr Kovář <pmkovar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] Treat a 500 response to MODE READER as OK
- Date: Wed, 23 Nov 2016 21:24:00 +0000 (UTC)
commit 194f2dc09dead55b6bc0e0ce49ce8b0d86ed65c4
Author: Per Hedeland <per hedeland org>
Date: Wed Nov 23 22:22:18 2016 +0100
Treat a 500 response to MODE READER as OK
https://bugzilla.gnome.org/show_bug.cgi?id=772116
pan/tasks/nntp.cc | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/pan/tasks/nntp.cc b/pan/tasks/nntp.cc
index 9a31ed5..bb8037b 100644
--- a/pan/tasks/nntp.cc
+++ b/pan/tasks/nntp.cc
@@ -119,11 +119,13 @@ NNTP :: on_socket_response (Socket * sock UNUSED, const StringView& line_in)
}
else
{
+ int code;
//check for compression, enable once, disable at end
if (!_compression)
_compression = strcasestr (line_in.str, COMPRESS_GZIP);
- switch (atoi (line.str))
+ code = atoi (line.str);
+ switch (code)
{
case SERVER_READY:
case SERVER_READY_NO_POSTING:
@@ -234,6 +236,12 @@ NNTP :: on_socket_response (Socket * sock UNUSED, const StringView& line_in)
std::string cmd (_previous_command);
if (cmd.size()>=2 && cmd[cmd.size()-1]=='\n' && cmd[cmd.size()-2]=='\r')
cmd.resize (cmd.size()-2);
+ if (code == ERROR_CMD_NOT_UNDERSTOOD &&
+ !strcmp (cmd.c_str(), "MODE READER")) {
+ // server clearly doesn't need MODE READER, ignore the error
+ state = CMD_DONE;
+ break;
+ }
std::string host;
_socket->get_host (host);
Log::add_err_va (_("Sending \"%s\" to %s returned an error: %s"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]