apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject Re: [PATCH] fixing bogus apr_date_parse_rfc()
Date Thu, 11 Aug 2005 02:49:08 GMT
Maxime Petazzoni wrote:
> Hi,
> While coding on mod_mbox for my Summer Of Code project, I discovered
> a strange malfunction in the sort by date function. I found that the
> timezone information in the RFC 2822 [1] date format [2] was not parsed
> by apr_date_parse_rfc() [3], the function used by mod_mbox to generate
> apr_time_t timestamps, thus making the date sort unreliable.
> I took a closer look to the function's code, and found that some index
> paddings in the date string were wrong (distance between the begining of
> the time and the begining of the timezone is 9, not 8).
> I've attached a patch including the fix and a test program. You can
> easily get test material with a mbox file :
> cd apr-util/test/
> grep -h -e "^Date: " ~/file.mbox > data/testdaterfc.input
> cat data/testdaterfc.input | ./testdaterfc | less

Would it be possible for you to rework your test for this problem into 
something that would fit in the APR-Util test suite?  I'm thinking that 
it shouldn't be all that hard to add the appropriate tests to 
testdate.c, but since you have the data that actually shows the problem 
and I don't, it's a lot easier for you to do it than for me to do it...


View raw message