INN commit: trunk/innd (nc.c)

INN Commit rra at isc.org
Sun Nov 8 15:06:23 UTC 2009


    Date: Sunday, November 8, 2009 @ 07:06:23
  Author: iulius
Revision: 8723

Streaming commands were still allowed when streaming was
deactivated.

Modified:
  trunk/innd/nc.c

------+
 nc.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Modified: nc.c
===================================================================
--- nc.c	2009-11-08 14:45:43 UTC (rev 8722)
+++ nc.c	2009-11-08 15:06:23 UTC (rev 8723)
@@ -1169,7 +1169,7 @@
         for (dp = NCcommands; dp < ARRAY_END(NCcommands); dp++) {
           if ((dp->Function != NC_unimp) &&
               (strcasecmp(cp->av[0], dp->Name) == 0)) {
-            if (!StreamingOff || cp->Streaming ||
+            if ((!StreamingOff && cp->Streaming) ||
                 (dp->Function != NCcheck && dp->Function != NCtakethis)) {
                 validcommandtoolong = true;
             }
@@ -1178,7 +1178,7 @@
             if (strcasecmp(cp->av[0], "IHAVE") == 0) {
               syntaxerrorcode = NNTP_FAIL_IHAVE_REFUSE;
             } else if (strcasecmp(cp->av[0], "CHECK") == 0
-                       && (!StreamingOff || cp->Streaming)) {
+                       && (!StreamingOff && cp->Streaming)) {
               syntaxerrorcode = NNTP_FAIL_CHECK_REFUSE;
             }
           }
@@ -1186,7 +1186,7 @@
         /* If TAKETHIS, we have to read the entire multi-line response
          * block before answering. */
         if (strcasecmp(cp->av[0], "TAKETHIS") != 0
-            || (StreamingOff && !cp->Streaming)) {
+            || (StreamingOff || !cp->Streaming)) {
           if (syntaxerrorcode == NNTP_FAIL_CHECK_REFUSE) {
             snprintf(buff, sizeof(buff), "%d %s", syntaxerrorcode,
                      cp->ac > 1 ? cp->av[1] : "");
@@ -1211,11 +1211,11 @@
           if (strcasecmp(cp->av[0], "IHAVE") == 0) {
               syntaxerrorcode = NNTP_FAIL_IHAVE_REFUSE;
           } else if (strcasecmp(cp->av[0], "CHECK") == 0
-                     && (!StreamingOff || cp->Streaming)) {
+                     && (!StreamingOff && cp->Streaming)) {
               syntaxerrorcode = NNTP_FAIL_CHECK_REFUSE;
           }
 	  /* Ignore the streaming commands if necessary. */
-	  if (!StreamingOff || cp->Streaming ||
+	  if ((!StreamingOff && cp->Streaming) ||
 	    (dp->Function != NCcheck && dp->Function != NCtakethis)) {
 	    break;
 	  }
@@ -1278,7 +1278,7 @@
               /* If TAKETHIS, we have to read the entire multi-line response
                * block before answering. */
               if (strcasecmp(cp->av[0], "TAKETHIS") != 0
-                  || (StreamingOff && !cp->Streaming)) {
+                  || (StreamingOff || !cp->Streaming)) {
                   NCwritereply(cp, buff);
                   cp->Start = cp->Next;
                   break;
@@ -1299,7 +1299,7 @@
           /* If TAKETHIS, we have to read the entire multi-line response
            * block before answering. */
           if (strcasecmp(cp->av[0], "TAKETHIS") != 0
-              || (StreamingOff && !cp->Streaming)) {
+              || (StreamingOff || !cp->Streaming)) {
               NCwritereply(cp, buff);
               cp->Start = cp->Next;
               break;
@@ -1319,7 +1319,7 @@
           /* If TAKETHIS, we have to read the entire multi-line response
            * block before answering. */
           if (strcasecmp(cp->av[0], "TAKETHIS") != 0
-              || (StreamingOff && !cp->Streaming)) {
+              || (StreamingOff || !cp->Streaming)) {
               NCwritereply(cp, buff);
               cp->Start = cp->Next;
               break;




More information about the inn-committers mailing list