[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Control characters in log message cause failure

From: Mark Benedetto King <mbk_at_lowlatency.com>
Date: 2004-12-02 17:47:30 CET

On Wed, Dec 01, 2004 at 05:32:54PM -0600, kfogel@collab.net wrote:
> "Peter N. Lundblad" <peter@famlundblad.se> writes:
> > > Mark Benedetto King <mbk@lowlatency.com> writes:
> > > > On Wed, Dec 01, 2004 at 02:08:34PM -0600, kfogel@collab.net wrote:
> > > > What does the receiver do when it receives the message? How does it know
> > > > which escaping mechanism to invert?
> > >
> > > Seriously, I've hand-waved on that detail. I was assuming could add
> > > an encoding attribute (I think we do that already).
> > >
> > We use the DAV element comment (in the DAV namespace) for the log message.
> > There is no encoding there, if we're talking about the XML used in the svn
> > log command.
>
> So the code should be:
>
> /* sending a log msg from server to client */
>
> if (is_valid_utf8 (msg) && svn_xml_is_xml_safe (msg))
> {
> send_message (escape_xml (msg));
> }
> else
> {
> send_message (fuzzy_escape (msg));
> }
>
> then? (This assumes that fuzzy_escape() produces totally XML-kosher
> data, naturally.)
>

Right, as long as fuzzy_escape() it is assumed to be lossy, since
we're always going to use unescape_xml() on the receiver-side.

Considering, then, that the receiver is capable of unescaping with
a single function, why isn't the transmitter capable of the same?

It sounds to me that we just have a lossy encoding, and dressing it
up with is_valid_utf8() and svn_xml_is_xml_safe() just obscures that
fact. The lossy encoding would just not be lossy if both of those
conditions were met. Or maybe I misunderstand what fuzzy_escape()
does. Does it incorrectly handle valid utf8, valid xml characters?

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 2 17:49:36 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.