[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KNode patch
From:       Christian Gebauer <gebauer () bigfoot ! com>
Date:       2000-08-30 21:45:44
[Download RAW message or body]

Hi,

Under certain conditions (broken groupinfo file) leafnode
sends text lines beginning with a single period 
(". 0000000001 0000000001 y\r\n"). This is not really legal,
but we should better not interpret this line as the end of the
message (".\r\n")

Index: knnntpclient.cpp
===================================================================
RCS file: /home/kde/kdenetwork/knode/knnntpclient.cpp,v
retrieving revision 1.11
diff -u -3 -p -r1.11 knnntpclient.cpp
--- knnntpclient.cpp    2000/08/21 13:18:39     1.11
+++ knnntpclient.cpp    2000/08/30 21:38:51
@@ -96,7 +96,8 @@ void KNNntpClient::doFetchGroups()
       if (line[1]=='.')
         line++;        // collapse double period into one
       else
-        break;        // message complete
+        if (line[1]==0)
+          break;   // message complete
     }
     s = strchr(line,' ');
     if(!s)
@@ -128,7 +129,8 @@ void KNNntpClient::doFetchGroups()
         if (line[1]=='.')
           line++;        // collapse double period into one
         else
-          break;        // message complete
+          if (line[1]==0)
+            break;   // message complete
       }
       s = line;
       while (*s != '\0' && *s != '\t' && *s != ' ') s++;
@@ -201,7 +203,8 @@ void KNNntpClient::doCheckNewGroups()
       if (line[1]=='.')
         line++;        // collapse double period into one
       else
-        break;        // message complete
+        if (line[1]==0)
+          break;   // message complete
     }
     s = strchr(line,' ');
     if(!s)
Index: knprotocolclient.cpp
===================================================================
RCS file: /home/kde/kdenetwork/knode/knprotocolclient.cpp,v
retrieving revision 1.15
diff -u -3 -p -r1.15 knprotocolclient.cpp
--- knprotocolclient.cpp        2000/08/21 13:18:39     1.15
+++ knprotocolclient.cpp        2000/08/30 21:38:51
@@ -389,7 +389,8 @@ bool KNProtocolClient::getMsg(QStrList &
       if (line[1]=='.')
         line++;        // collapse double period into one
       else
-        return true;   // message complete
+        if (line[1]==0)
+          return true;   // message complete
     }
     msg.append(line);
     doneLines++;       
-- 
>><< Christian Gebauer >><< gebauer@bigfoot.com >><< ICQ 14916141 >><<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic