[prev in list] [next in list] [prev in thread] [next in thread] 

List:       inn-workers
Subject:    Re: Interpretation of maintenance of information
From:       Bill Davidsen <davidsen () tmr ! com>
Date:       2008-03-23 14:19:49
Message-ID: 47E66705.4010001 () tmr ! com
[Download RAW message or body]

Julien ÉLIE wrote:
> 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?
>
>   
Your suggested version seems more correct, if it's required there's and 
error and it should be logged. I see no benefit from 215, 503 seems to 
be the correct (and more useful to the client) reply.

-- 
Bill Davidsen <davidsen@tmr.com>
  "Woe unto the statesman who makes war without a reason that will still
  be valid when the war is over..." Otto von Bismark 




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic