ietf-nntp DEBUG command & x9x (was: 9xx)

Clive D.W. Feather clive at demon.net
Sat Aug 5 15:11:32 PDT 2000


Russ Allbery said:
>> Clive also suggested
>> to make a best guess based on first digit.
> 
> The only problem that I have with making decisions based on the first
> digit is what to do with commands that normally return multiline
> responses?  If you guess that an unrecognized code is actually the
> expected return (the beginning of a multiline response) and that code
> isn't actually beginning a multiline response, you get into protocol
> trouble.

Yes, I thought about that but couldn't see any good answers.

Thoughts:

* If the command doesn't have any multiline responses, assume that unknown
  codes are not multiline.
* If all legitimate 2XX responses are multiline (I don't think we have
  any multiline responses that *aren't* 2XX, do we ?), then assume that
  an unknown 2XX is multiline, but nothing else is.
* If some 2XX responses are multiline, but not all, it's harder.
* You could send something innocuous and unusual, like DATE, then:
  - if the next line of input begins 111, the odd response was on its own;
  - otherwise the next line was multiline, so skip down to the dot.
* You could assume that any further lines will appear within 10 seconds,
  so do a read with timeout on the socket.

-- 
Clive D.W. Feather  | Work:  <clive at demon.net>   | Tel:  +44 20 8371 1138
Internet Expert     | Home:  <clive at davros.org>  | Fax:  +44 20 8371 1037
Demon Internet      | WWW: http://www.davros.org | DFax: +44 20 8371 4037
Thus plc            |                            | Mobile: +44 7973 377646 



More information about the ietf-nntp mailing list