[Mono-dev] Custom Uri Parsing

Alan McGovern alan.mcgovern at gmail.com
Fri Feb 19 08:42:00 EST 2010


Hey,

On Fri, Feb 12, 2010 at 6:52 PM, Matt Dargavel <matt at shout-telecoms.com>wrote:

>  Thanks for the info Alan.
>
>
>
> At the moment I’ve put together a very quick and dirty version that uses
> IsPredefinedScheme to decide whether to use the existing parsing code or use
> the registered Parser class when the Uri is first created (and parsed).
>
That might be the best way to get started alright.

> I was wondering whether something along the lines of moving the existing
> parsing routine in to DefaultUriParser and use this for the predefined
> schemes might be possible.  You might then be able to replace this with the
> proper Parser classes for the built in schemes one by one.  This would allow
> people to write parsers for unsupported schemes, and would hopefully pass
> the existing tests.
>
It's quite possible that this will be the easiest (and best) way to start
off. I'm interested in any progress you make on this as  I'll be able to fix
some long-standing issues with the System.IO.Packaging API in the
WindowsBase assembly when this is implemented. It needs a proper UriParser
subclass which isn't possible right now.

Thanks,
Alan.

>
>
> Anyway, I’ll look in to it a bit more and see if I can come up with a more
> definite suggestion.
>
>
>
>                 Cheers,
>
>
>
>                                 Matt.
>
>
>
>
>
> *From:* Alan McGovern [mailto:alan.mcgovern at gmail.com]
> *Sent:* 11 February 2010 11:45 PM
> *To:* Miguel de Icaza
> *Cc:* Matt Dargavel; mono-devel-list at lists.ximian.com
> *Subject:* Re: [Mono-dev] Custom Uri Parsing
>
>
>
> Hey,
>
> The main reason why I didn't actually do any work on this at the time is
> that it would probably take 1 man month to do the rewrite, pass the existing
> tests and write more tests for the new behaviours and I didn't have a month
> free to do it ;) Proper support for the new parser API is required to
> properly support System.IO.Packaging, so I'd be willing to offer any advice
> if you want to take on the task.
>
> The biggest problem (as I saw it at the time) is that this is an all or
> nothing kind of patch. It might be impossible to do this one uri scheme at a
> time without making things ridiculously complicated internally. While the
> existing code will be useful as a guide, you will end up chopping it up into
> tiny pieces and moving it around into the different parser subclasses.
>
> Alan.
>
> p.s. The above should be mostly accurate, but the last time I looked at
> this was when I sent the original email ;)
>
> On Thu, Feb 11, 2010 at 5:09 AM, Miguel de Icaza <miguel at novell.com>
> wrote:
>
> Hello,
>
>
>
> Some searching also threw up this post to the list back in October 2008:
> http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg18617.html .
> I’ve looked in to the Mono implementation in svn, and it still appears that
> most of the Uri class decodes specific Uri content itself rather than
> delegating to Uri parsers.
>
>
>
> I do not believe we ever moved to that scheme of Uri parsing.
>
>
>
>   I was wondering if anyone knew if the post above was ever followed up,
> or whether the suggestion wasn’t implemented for some reason?  I guess this
> should probably be filed as a bug, as the functionality was added in .NET 2?
>  If you’d welcome a patch I could probably submit something based on Alan’s
> suggestion.
>
>
>
> I would love to see a patch based on Alan's patch.
>
>
>
> It should be simpler these days since Mono trunk has dropped support for
> 1.0 compatibility
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100219/76cb4ce3/attachment.html 


More information about the Mono-devel-list mailing list