Re: mudFTP problems continued

From: George (greerga@CIRCLEMUD.ORG)
Date: 09/27/98

On Sun, 27 Sep 1998, James Turner wrote:

>> +    if (ISNEWL(*nl_pos))
>> +      nl_pos++;
>> +    if (ISNEWL(*nl_pos))
>>        nl_pos++;
>> That'd also work for \n\r but break on a simple \r or \n.
>I don't think this will work -- what if there are two \n's in the
>input stream, with no intervening \r?  The client sends strictly in
>Unix type file mode I believe -- never a \r.  I could perhaps be
>mistaken, though.  So two blank lines get transmitted as "\n\n" which
>causes the problem.

It'll strip two \n's if there are two \n's.  I'm not quite sure how the
mudFTP client sends, but commenting out the above code doesn't work either.
(infinite loop).  Could create an exception for mudFTP in there.

>The right answer is to skip exactly one \n, and exactly one \r on one
>side of the \n or the other (not both).  I think, anyway.  The mudFTP
>client totally strips out \r's, so skipping twice won't work, since it
>can hit two \n's.

If clients send either \n\r and \r\n, the above works with both.  Just
doesn't work with the single \r or \n as I noted originally.  They _should_
be sending \r\n.

>What do most clients send?  Do they conform?  I assume they send \r or
>\n but not both -- correct?

Telnet RFC says \r\n but some MUDs send \n\r, including some in CircleMUD
until recently. I wouldn't be suprised if the clients copied the \n\r
behavior since the MUD does it.

George Greer, | Genius may have its limitations, but   (mostly) | stupidity is not thus handicapped.    |                  -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST