[pan2] fix astraweb xzver, append \r\n



commit 6daf184e748f7ac207215ea78aea51bf97c682df
Author: Heinrich Müller <heinrich mueller82 gmail com>
Date:   Fri Dec 20 22:36:41 2013 +0100

    fix astraweb xzver, append \r\n

 pan/tasks/nntp.cc       |    2 +-
 pan/tasks/task-xover.cc |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/pan/tasks/nntp.cc b/pan/tasks/nntp.cc
index ff12a43..d34eae6 100644
--- a/pan/tasks/nntp.cc
+++ b/pan/tasks/nntp.cc
@@ -109,7 +109,7 @@ NNTP :: on_socket_response (Socket * sock UNUSED, const StringView& line_in)
         if (_listener)
           _listener->on_nntp_line (this, l);
 
-        if (l.str[l.len-1]=='.')
+        if (l.str[l.len-1]=='.') // gzip compression, ends with a single "."
         {
           _nntp_response_text = false;
           _compression = false;
diff --git a/pan/tasks/task-xover.cc b/pan/tasks/task-xover.cc
index 05a4d2b..88d7b35 100644
--- a/pan/tasks/task-xover.cc
+++ b/pan/tasks/task-xover.cc
@@ -303,6 +303,8 @@ TaskXOver::on_nntp_line(NNTP * nntp, const StringView & line)
     if (_streams.count(sock_id) == 0)
       _streams[sock_id] = new std::stringstream();
     *_streams[sock_id] << line;
+    // \r\n was stripped, append it again because ydecode needs it
+    if (comp == HEADER_COMPRESS_XZVER || comp == HEADER_COMPRESS_DIABLO) *_streams[sock_id] <<"\r\n";
   }
   else
     on_nntp_line_process(nntp, line);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]