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

Re: [PATCH] mime-type detection "improvement"

From: Matthew Hambley <matthew_at_aether.demon.co.uk>
Date: 2003-07-09 23:03:35 CEST

In message <3F0C6763.7090600@slog.dk>
          SLOGEN <jensen@slog.dk> wrote:

> kfogel@collab.net wrote:
[snip]
> > http://subversion.tigris.org/issues/show_bug.cgi?id=1233
>
> Seems (after some truble uudecoding mail attachment served as HTML :) to
> do exactly what I'm trying to do

I thank you.

> Major differences are:
>
> + 1233 has test (big "+" there)

You have no idea how much blood I sweated getting those damn things
written. The biggest headache was updating all the other tests to take
into account the fact that files now have MIME type information. It still
fails two tests but I don't understand the system well enough to spot
what's going wrong.

> - 1233 parses mime.types file for every time a type-guess is req'ed, I
> do one parse into an apr_hash_t, and use that for lookup

This is for a number of reasons. Firstly, parsing as needed means that the
client isn't carrying a whole load of unnecesary baggage arround with it
most of the time. Secondly, I chose the nieve approach so as to have
something working to prove the worth of the concept. Once that is in
improvements can be made.

> - 1233 tries to work only on unix (it should work just fine on other
> platforms, only the paths for mime.types should be different)

Correction: It will work on other platforms which have mime.types files.
In other words, *nix. Windows, for instance, uses the registry to store
MIME type mappings. Risc OS (my own favourite) uses a relocatable module
to perform MIME type mapping. I tried to implement things in a modular
fashion so as to aid the addition of other platforms mechanisms.

> Points:
>
> * 1233 is a "better" patch (to start with anyway)

<Glows with pride>

> * The hashing approach should be directly transferable to 1233 (and i
> would be happy to do it, should 1233 be accepted into svn)

If you want it to be, (accepted) vote for it. I don't think it's right for
the author to vote for their pach so I haven't. The fact that I wrote the
patch should be considered an implicit vote for it.

> * Making 1233 work on all platforms only requires minor changes

Making it work on all *nix platform only requires minor changes. Making it
work on other platforms will require some extra work although hopefully not
too much.

> * The list of files to parse mime.types from should probably be in a
> svn_config variable, with a compiled default (possibly depending on the
> platform)

Obviously, but walk before you run.

> Unfortunatly, I'm unable to track down the mail-address of the submitter
> of the patch mentioned in issue 1233, or I would have CC'ed him.

That would be me. Thanks for your interest. If we can scrape together a
bit more interest we might get something accepted into the code base.

-- 
(\/)atthew )-(ambley ---------------\ If something's worth doing it's worth
E-mail : matthew@aether.demon.co.uk  \ doing badly until you can learn to
Public key : C991137B                 \ do it well.
Web : http://www.aether.demon.co.uk/   \-----------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 9 23:04:57 2003

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.