[PATCH] HTTP date parsing and formatting

Dridi Boukelmoune dridi.boukelmoune at zenika.com
Tue Feb 17 00:09:40 CET 2015


Hi,

I have a set of patches that serve two purposes:
- fixing the current date parsing
- not breaking when the locale changes

--->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8---
0001-Add-a-new-function-VOID-debug.setlocale-STRING.patch

This patches adds a setlocale function to the debug vmod,
because only a vmod could change the locale. It also improves
the test m00020 and makes it run again with a different locale.

0002-Replace-strftime-3-for-HTTP-1.1-date-formatting.patch
0003-Replace-strptime-3-for-HTTP-date-parsing.patch

Straightforward replacement for strftime, a little more effort has
been put in strptime's replacement (the latter is not compliant
anyway).

0004-Add-a-new-VNUM_2real-function.patch

Because when you think you're done, it turns out the whole libc
relies on a process-wide locale.

0005-Remove-support-for-the-ISO-8601-date-format.patch

Bonus patch, I don't know where the support for this date format
comes from. If you decide to remove it, you can apply this patch.
--->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8---

I'm willing to continue looking for locale-dependant code and sending
patches, I'd like to see how this patch set will be commented first.

The locale part is really just for vmods that may do a library call that
would lead to setlocale. If you don't want the locale part, I can send a
smaller patch set that will only improve the date parsing correctness
(and the test case).

Best Regards,
Dridi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-new-function-VOID-debug.setlocale-STRING.patch
Type: text/x-patch
Size: 3783 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150217/5647027c/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Replace-strftime-3-for-HTTP-1.1-date-formatting.patch
Type: text/x-patch
Size: 1657 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150217/5647027c/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Replace-strptime-3-for-HTTP-date-parsing.patch
Type: text/x-patch
Size: 5034 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150217/5647027c/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-a-new-VNUM_2real-function.patch
Type: text/x-patch
Size: 4655 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150217/5647027c/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Remove-support-for-the-ISO-8601-date-format.patch
Type: text/x-patch
Size: 4047 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20150217/5647027c/attachment-0009.bin>


More information about the varnish-dev mailing list