INN commit: branches/2.5 (include/nntp.h innd/nc.c)

INN Commit rra at isc.org
Sun Nov 15 09:27:50 UTC 2009


    Date: Sunday, November 15, 2009 @ 01:27:50
  Author: iulius
Revision: 8791

Better response when an article is cancelled.

Modified:
  branches/2.5/include/nntp.h
  branches/2.5/innd/nc.c

----------------+
 include/nntp.h |    5 -----
 innd/nc.c      |    7 ++++---
 2 files changed, 4 insertions(+), 8 deletions(-)

Modified: include/nntp.h
===================================================================
--- include/nntp.h	2009-11-15 09:27:41 UTC (rev 8790)
+++ include/nntp.h	2009-11-15 09:27:50 UTC (rev 8791)
@@ -41,8 +41,3 @@
 #define NNTP_CLASS_OK			'2'
 #define NNTP_CLASS_ERROR		'4'
 #define NNTP_CLASS_FATAL		'5'
-
-/*
-**  MODE CANCEL extension.
-*/
-#define NNTP_OK_CANCELLED       "289"

Modified: innd/nc.c
===================================================================
--- innd/nc.c	2009-11-15 09:27:41 UTC (rev 8790)
+++ innd/nc.c	2009-11-15 09:27:50 UTC (rev 8791)
@@ -1845,6 +1845,7 @@
 NCcancel(CHANNEL *cp)
 {
     char *argv[2] = { NULL, NULL };
+    char buff[SMBUF];
     const char *res;
 
     ++cp->Received;
@@ -1852,14 +1853,14 @@
     cp->Start = cp->Next;
     res = CCcancel(argv);
     if (res) {
-        char buff[SMBUF];
-
         snprintf(buff, sizeof(buff), "%d %s", NNTP_FAIL_CANCEL,
                  MaxLength(res, res));
         syslog(L_NOTICE, "%s cant_cancel %s", CHANname(cp),
                MaxLength(res, res));
         NCwritereply(cp, buff);
     } else {
-        NCwritereply(cp, NNTP_OK_CANCELLED);
+        snprintf(buff, sizeof(buff), "%d Article cancelled OK",
+                 NNTP_OK_CANCEL);
+        NCwritereply(cp, buff);
     }
 }




More information about the inn-committers mailing list