[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DISC] Escaping #$#

>> A received network line that begins with the characters
>>   <SAMP>#$"</SAMP>
>> translates to an in-band line consisting of the suffix beyond the
>> first 3 characters (even if that suffix happens to begin with
>> <SAMP>#$"</SAMP> or <SAMP>#$#</SAMP>).
> I dunno about this bit; should this be #$#"?
> It's not a big deal, but it seems cleaner to me.

I thought that way at first, but then I realized that

(1) any implementation was going to have to treat the quote prefix
(whether it be #$#" or #$") entirely different from the OOB prefix
(#$#), i.e., the quote ISN'T a kind of OOB msg.  If the quote prefix
begins with the OOB prefix, then it's easier for the implementer to
screw up and, e.g., get the tests in the wrong order and attempt to
interpret the quoted line as an OOB...

More importantly, 

(2) seeing as existing clients/servers don't know about the quote
prefix, I'd much rather that quoted lines sent to them SHOW UP (albeit
prefixed with #$" junk) rather than being quietly dropped on the floor
by MCP dispatchers (as would happen with #$#" lines).  Since we're
unavoidably garbling data, it's best to garble it in an obvious way,
and occasional lines that begin with #$" will be much easier to spot
than occasional lines that are missing.  In the former case, users
will know something's wrong and there will thus be incentive to
upgrade said clients/servers to conform to the spec.