INN commit: trunk/nnrpd (article.c)

INN Commit Russ_Allbery at isc.org
Sat Sep 13 15:29:35 UTC 2008


    Date: Saturday, September 13, 2008 @ 08:29:35
  Author: iulius
Revision: 8025

Answer 503 when the OVER MSGID capability is used.
Also fix the return codes of XOVER, which should be 224 and not 423
when no articles are available.

Modified:
  trunk/nnrpd/article.c

-----------+
 article.c |   29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

Modified: article.c
===================================================================
--- article.c	2008-09-12 22:16:35 UTC (rev 8024)
+++ article.c	2008-09-13 15:29:35 UTC (rev 8025)
@@ -885,6 +885,12 @@
     xover = (strcasecmp(av[0], "XOVER") == 0);
     mid = (ac > 1 && IsValidMessageID(av[1]));
 
+    if (mid && !xover) {
+        /* FIXME:  We still do not support OVER MSGID, sorry! */
+        Reply("%d Overview by message-ID unsupported\r\n", NNTP_ERR_UNAVAILABLE);
+        return;
+    }
+
     /* Check the syntax of the arguments first.
      * We do not accept a message-ID for XOVER, contrary to OVER.  A range
      * is accepted for both of them. */
@@ -901,12 +907,6 @@
         }   
     }
 
-    if (mid) {
-        /* FIXME:  We still do not support OVER MSGID, sorry! */
-        Reply("%d Overview by message-ID unsupported\r\n", NNTP_ERR_UNAVAILABLE);
-        return;
-    }
-
     /* Check authorizations. */
     if (!PERMcanread) {
 	Reply("%d Read access denied\r\n", NNTP_ERR_ACCESS);
@@ -930,13 +930,16 @@
         gettimeofday(&stv, NULL);
     }
     if ((handle = (void *)OVopensearch(GRPcur, range.Low, range.High)) == NULL) {
-        /* The response code for OVER is different if a range is provided. */
+        /* The response code for OVER is different if a range is provided.
+         * Note that XOVER answers OK. */
         if (ac > 1)
             Reply("%d No articles in %s\r\n",
-                  xover ? NNTP_FAIL_NO_ARTICLE : NNTP_FAIL_BAD_ARTICLE, av[1]);
+                  xover ? NNTP_OK_OVER : NNTP_FAIL_BAD_ARTICLE, av[1]);
         else
             Reply("%d Current article number %d is invalid\r\n",
-                  NNTP_FAIL_NO_ARTICLE, ARTnumber);
+                  xover ? NNTP_OK_OVER : NNTP_FAIL_NO_ARTICLE, ARTnumber);
+        if (xover)
+            Reply(".\r\n");
         return;
     }
     if (PERMaccessconf->nnrpdoverstats) {
@@ -1025,12 +1028,16 @@
         cvector_free(vector);
 
     if (HasNotReplied) {
+        /* The response code for OVER is different if a range is provided.
+         * Note that XOVER answers OK. */
         if (ac > 1)
             Reply("%d No articles in %s\r\n",
-                  xover ? NNTP_FAIL_NO_ARTICLE : NNTP_FAIL_BAD_ARTICLE, av[1]);
+                  xover ? NNTP_OK_OVER : NNTP_FAIL_BAD_ARTICLE, av[1]);
         else
             Reply("%d Current article number %d is invalid\r\n",
-                  NNTP_FAIL_NO_ARTICLE, ARTnumber);
+                  xover ? NNTP_OK_OVER : NNTP_FAIL_NO_ARTICLE, ARTnumber);
+        if (xover)
+            Reply(".\r\n");
     } else {
         if(useIOb) {
             SendIOb(".\r\n", 3);



More information about the inn-committers mailing list