[Privoxy-devel] --enable-strptime-sanity-checks does what?

Fabian Keil fk at fabiankeil.de
Tue May 3 08:37:30 UTC 2016


Lee <ler762 at gmail.com> wrote:

> Right now I'm feeling like I can't read code :(   What's the expected
> behavior if --enable-strptime-sanity-checks is configured & this bit
> is added to regression-tests.action after
> {+hide-if-modified-since{-60} -crunch-if-none-match}
> # Set Header    = If-Modified-Since: Gee, this date is invalid
> # Expect Header = REMOVAL
> 
> # Set Header    = If-Modified-Since: Monday, 01-Jan-2025 00:15:00 GMT
> # Expect Header = SOME CHANGE
> # Set Header    = If-Modified-Since: wednesday, 01-Jan-2025 00:15:00 GMT
> # Expect Header = SOME CHANGE
> 
> 1/1/2025 can't be both Mon & Wed so shouldn't one of them cause a complaint?

The strptime() sanity check merely confirms that parsing a date format
generated from a time_t results in the same time_t again.

This happens after the original date has been parsed. If strptime()
silently ignores incorrect weekdays the expected behaviour is therefore
that the check does not detect this.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20160503/f7c4cd83/attachment.bin>


More information about the Privoxy-devel mailing list