Re: Patch to provide support for application/x-zerosize

Thomas Leonard <[email protected]> Sat, 22 Sep 2012 12:25:24 +0100
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <CAG4opy_sF-9n-J+5R+M9S3C+i_zbiHup-0wjFUPy2rUd9hp1Kg@mail.gmail.com>
On 21 September 2012 16:22, Norm Pierce <[email protected]> wrote:
> Attached is a patch to provide support in ROX-Filer for the
> application/x-zerosize MIME type.
>
> The changes made to the code are mostly just a subset of the changes in a
> patch submitted to the xdgmime code base by David Faure.  (See
> "xdg/xdgmime: Implement text vs binary fallback; support for
> application/x-zerosize" at
> http://cgit.freedesktop.org/xdg/xdgmime/commit/?id=5181175d5fdaa3832b0fd094cda0120b1fe92af6
> )  My only contributions were to make a small change in the
> diritem_restat() function so empty files are no longer assumed to be
> text/plain, and to make a change to the xdg_mime_get_mime_type_for_file()
> function identical to a change Faure made to the
> _xdg_mime_cache_get_mime_type_for_file() function; this fixes an omission
> in his patch so that this will still work even if there is no support for
> the mime.cache file.
>
> Note that David Faure's patch also adds support for guessing whether a
> file is binary or text if no other method has been able to identify the
> MIME type.  ROX-Filer has had support for that since 2005 (with a short
> vacation from 2007-08-18 to 2008-01-21 when the code had been mistakenly
> removed).  I have retained the ROX-Filer code for that support and not
> implemented David Faure's related changes.

Well, I don't think we should diverge too far from upstream, so I've
merged in the latest code from there and then applied your patches on
top.

Are you going to upstream the zero-length fix? If so, you might want
to send them this use-after-free fix at the same time:

http://repo.or.cz/w/rox-filer.git/commitdiff/97f32448e491de3a824ce7e3723d3db9a80df12c

I haven't looked at why caching is off. Should we enable it?


-- 
Dr Thomas Leonard        http://0install.net/
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html