Interpretation of maintenance of information
Julien ÉLIE
julien at trigofacile.com
Sun Mar 23 00:10:37 UTC 2008
Hi,
Regarding LIST:
If the keyword is not recognised, or if an argument is specified and
the keyword does not expect one, a 501 response code MUST BE
returned. If the keyword is recognised but the server does not
maintain the information, a 503 response code MUST BE returned.
Example of LIST returning an error where the keyword is recognized
but the software does not maintain this information:
[C] LIST XTRA.DATA
[S] 503 Data item not stored
Currently, only a problem with <pathdb>/active or an existing but
unreadable file triggers a 503 answer in nnrpd/list.c:
qp = QIOopen(path);
if (qp == NULL) {
/* Only the active and overview.fmt files are required (but the last
* one has already called cmd_list_schema). If the other files are not
* available, we act as though they were empty. */
if (!lp->Required && errno == ENOENT) {
Reply("%d %s.\r\n", NNTP_OK_LIST, lp->Format);
Printf(".\r\n");
} else {
/* %m outputs strerror(errno). */
syslog(L_ERROR, "%s cant fopen %s %m", Client.host, lp->File);
Reply("%d No list of %s available.\r\n",
NNTP_ERR_UNAVAILABLE, lp->Items);
}
Shouldn't it be changed to:
qp = QIOopen(path);
if (qp == NULL) {
Reply("%d No list of %s available.\r\n",
NNTP_ERR_UNAVAILABLE, lp->Items);
/* Only the active and overview.fmt files are required (but the last
* one has already called cmd_list_schema). */
if (lp->Required || errno != ENOENT) {
/* %m outputs strerror(errno). */
syslog(L_ERROR, "%s cant fopen %s %m", Client.host, lp->File);
}
return;
}
That is to say returning 503 whenever qp == NULL.
Or do you prefer to send an empty answer (with the usual 215 return)?
In fact, it depends on what the sentence "the software does not maintain
this information" means... If the file does not exist, should INN assume
it is empty or it is missing?
--
Julien ÉLIE
« Un clavier azerty en vaut deux. »
More information about the inn-workers
mailing list