INN commit: branches/2.5/innd (nc.c)
INN Commit
rra at isc.org
Sun Nov 15 09:20:21 UTC 2009
Date: Sunday, November 15, 2009 @ 01:20:20
Author: iulius
Revision: 8760
When innd cannot provide information for LIST NEWSGROUPS
and LIST ACTIVE.TIMES, it now returns 503. It was giving
an invalid result (".\r\n" without any response code!).
Modified:
branches/2.5/innd/nc.c
------+
nc.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
Modified: nc.c
===================================================================
--- nc.c 2009-11-15 09:20:09 UTC (rev 8759)
+++ nc.c 2009-11-15 09:20:20 UTC (rev 8760)
@@ -690,23 +690,45 @@
/* ACTIVE when no argument given. */
if (ac == 1 || (strcasecmp(av[1], "ACTIVE") == 0)) {
p = ICDreadactive(&end);
+ /* We always have a valid return from ICDreadactive.
+ * Otherwise, innd is shut down. */
+ xasprintf(&buff, "%d Newsgroups in form \"group high low flags\"",
+ NNTP_OK_LIST);
+ NCwritereply(cp, buff);
+ free(buff);
} else if (strcasecmp(av[1], "NEWSGROUPS") == 0) {
path = concatpath(innconf->pathdb, INN_PATH_NEWSGROUPS);
p = ReadInFile(path, NULL);
free(path);
if (p == NULL) {
- NCwritereply(cp, NCdot);
+ xasprintf(&buff, "%d No list of newsgroup descriptions available",
+ NNTP_ERR_UNAVAILABLE);
+ NCwritereply(cp, buff);
+ free(buff);
return;
- }
+ } else {
+ xasprintf(&buff, "%d Descriptions in form \"group description\"",
+ NNTP_OK_LIST);
+ NCwritereply(cp, buff);
+ free(buff);
+ }
end = p + strlen(p);
} else if (strcasecmp(av[1], "ACTIVE.TIMES") == 0) {
path = concatpath(innconf->pathdb, INN_PATH_ACTIVETIMES);
p = ReadInFile(path, NULL);
free(path);
if (p == NULL) {
- NCwritereply(cp, NCdot);
+ xasprintf(&buff, "%d No list of creation times available",
+ NNTP_ERR_UNAVAILABLE);
+ NCwritereply(cp, buff);
+ free(buff);
return;
- }
+ } else {
+ xasprintf(&buff, "%d Group creations in form \"name time who\"",
+ NNTP_OK_LIST);
+ NCwritereply(cp, buff);
+ free(buff);
+ }
end = p + strlen(p);
} else {
xasprintf(&buff, "%d Unknown LIST keyword", NNTP_ERR_SYNTAX);
@@ -716,8 +738,6 @@
}
/* Loop over all lines, sending the text and "\r\n". */
- WCHANappend(cp, NNTP_LIST_FOLLOWS, strlen(NNTP_LIST_FOLLOWS));
- WCHANappend(cp, NCterm, strlen(NCterm)) ;
for (; p < end && (q = strchr(p, '\n')) != NULL; p = q + 1) {
WCHANappend(cp, p, q - p);
WCHANappend(cp, NCterm, strlen(NCterm));
More information about the inn-committers
mailing list