APR::Date

APR::Date

am 14.03.2005 22:00:10 von MJH

According to the docs, APR::Date::http parses the format:
Sun, 06 Nov 1994 08:49:37 GMT
as per RFC 822.
However it does not seem to parse
Sun, 06 Nov 1994 08:49:37 EST
correctly. It assumes it's GMT regardless of the timezone specified. If I'm
reading RC822 correctly, this is an error.




--
We find comfort among those who agree with us--growth among those who don't.
- Frank A Clark

Re: APR::Date

am 15.03.2005 01:02:08 von Stas Bekman

Malcolm J Harwood wrote:
> According to the docs, APR::Date::http parses the format:
> Sun, 06 Nov 1994 08:49:37 GMT
> as per RFC 822.
> However it does not seem to parse
> Sun, 06 Nov 1994 08:49:37 EST
> correctly. It assumes it's GMT regardless of the timezone specified. If I'm
> reading RC822 correctly, this is an error.

Looks like we don't test anything but GMT :(

Malcolm, mind to add the non-GMT tests to t/lib/TestAPRlib/date.pm in the
source package, and we will work on fixing those? Probably matching the
same timestamp when decoded, but encoded in EST (and may be other TZ as well)

You can run this test w/o even starting the server, via:

t/TEST -v -no t/apr-ext/date.t

Thanks.

--
____________________________________________________________ ______
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com

Re: APR::Date

am 15.03.2005 02:26:23 von Joe Schaefer

Stas Bekman writes:

> Malcolm J Harwood wrote:
>> According to the docs, APR::Date::http parses the format:
>> Sun, 06 Nov 1994 08:49:37 GMT
>> as per RFC 822.
>> However it does not seem to parse
>> Sun, 06 Nov 1994 08:49:37 EST
>> correctly. It assumes it's GMT regardless of the timezone
>> specified. If I'm reading RC822 correctly, this is an error.
>
> Looks like we don't test anything but GMT :(
>
> Malcolm, mind to add the non-GMT tests to t/lib/TestAPRlib/date.pm in
> the source package, and we will work on fixing those?

IMO this doesn't need fixing; if anything this is a doc bug.
The apr_date_parse_* functions assume GMT because that's the
timezone 2616 Section 3.3 requires.

--
Joe Schaefer

Re: APR::Date

am 17.03.2005 03:30:47 von Stas Bekman

Joe Schaefer wrote:
> Stas Bekman writes:
>
>
>>Malcolm J Harwood wrote:
>>
>>>According to the docs, APR::Date::http parses the format:
>>> Sun, 06 Nov 1994 08:49:37 GMT
>>>as per RFC 822.
>>>However it does not seem to parse
>>> Sun, 06 Nov 1994 08:49:37 EST
>>>correctly. It assumes it's GMT regardless of the timezone
>>>specified. If I'm reading RC822 correctly, this is an error.
>>
>>Looks like we don't test anything but GMT :(
>>
>>Malcolm, mind to add the non-GMT tests to t/lib/TestAPRlib/date.pm in
>>the source package, and we will work on fixing those?
>
>
> IMO this doesn't need fixing; if anything this is a doc bug.
> The apr_date_parse_* functions assume GMT because that's the
> timezone 2616 Section 3.3 requires.

Thanks Joe.

What should the manpage say? something like the following?

The function assumes GMT, regardless of the used timezone,
according to RFC 2616 Section 3.3 requires.



--
____________________________________________________________ ______
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com

Re: APR::Date

am 17.03.2005 04:19:07 von Joe Schaefer

Stas Bekman writes:


[...]

> What should the manpage say? something like the following?
>
> The function assumes GMT, regardless of the used timezone,
> according to RFC 2616 Section 3.3 requires.

No need to mention the RFC; how about this?

APR::Date::parse_http is a perl wrapper for the
apr_date_parse_http() function provided by libaprutil.
Please check your libaprutil documentation for a complete
list of supported formats and restrictions (in particular,
this function assumes GMT, regardless of the used timezone).

--
Joe Schaefer

Re: APR::Date

am 17.03.2005 04:37:32 von Stas Bekman

Joe Schaefer wrote:
> Stas Bekman writes:
>
>
> [...]
>
>
>>What should the manpage say? something like the following?
>>
>> The function assumes GMT, regardless of the used timezone,
>> according to RFC 2616 Section 3.3 requires.
>
>
> No need to mention the RFC; how about this?
>
> APR::Date::parse_http is a perl wrapper for the
> apr_date_parse_http() function provided by libaprutil.
> Please check your libaprutil documentation for a complete
> list of supported formats and restrictions (in particular,
> this function assumes GMT, regardless of the used timezone).

Grr, it's OK if you tell me about apr_date_parse_http(), it's the best to
save the perl users the trouble of learning about the existence of the
underlying C API. Especially since for the most part the C API is either
very terse or most of the time lacking completely. And they need to figure
out where to get that documentation. I'd rather document whatever is
needed to help the perl users to get most of the information in the perl
API manpages. And only in the more advanced cases point to the C API.


--
____________________________________________________________ ______
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com

Re: APR::Date

am 17.03.2005 04:55:23 von MJH

On Wednesday 16 March 2005 10:19 pm, Joe Schaefer wrote:

> > What should the manpage say? something like the following?
> > The function assumes GMT, regardless of the used timezone,
> > according to RFC 2616 Section 3.3 requires.
> No need to mention the RFC; how about this?

The current doc says:
# parse RFC822-complient date string

Which it doesn't (as RFC822 includes multiple timezones). In fact none of the
RFCs listed are 2616. Whilst parse_http does seem like it should follow
RFC2616, is thare a reason parse_rfc should too?

> APR::Date::parse_http is a perl wrapper for the
> apr_date_parse_http() function provided by libaprutil.
> Please check your libaprutil documentation for a complete
> list of supported formats and restrictions (in particular,
> this function assumes GMT, regardless of the used timezone).

How about simply correcting the parse_http docs from:
The date string can be in one of the following formats:
to:
The date string can be in one of the following formats (as per RFC2616):

That way anyone interested can look up the correct RFC if they want the gory
details.

I'm not sure about parse_rfc as I'm not sure what it's actually supposed to be
able to parse.

Re: APR::Date

am 17.03.2005 05:12:26 von Joe Schaefer

Malcolm J Harwood writes:

[...]

> The current doc says:
> # parse RFC822-complient date string
>
> Which it doesn't (as RFC822 includes multiple timezones).

Which is *exactly* why I recommended the docs include a pointer to
aprutil. All modperl does it wrap the C function; it provides
no guarantees about the behavior itself (other than what's in
the test suite), so it doesn't surprise me that there's an error
in the wrapper documentation.

[...]

> How about simply correcting the parse_http docs from:
> The date string can be in one of the following formats:
> to:
> The date string can be in one of the following formats (as per RFC2616):
>
> That way anyone interested can look up the correct RFC if they want the gory
> details.

The RFC is a guideline, not the final arbiter. This link is exactly
what you are looking for:

http://apr.apache.org/docs/apr-util/group___a_p_r___util___d ate.html#ga1


--
Joe Schaefer

Re: APR::Date

am 18.03.2005 02:16:49 von MJH

On Wednesday 16 March 2005 11:12 pm, Joe Schaefer wrote:

> > How about simply correcting the parse_http docs from:
> > The date string can be in one of the following formats:
> > to:
> > The date string can be in one of the following formats (as per RFC2616):
> >
> > That way anyone interested can look up the correct RFC if they want the
> > gory details.
> The RFC is a guideline, not the final arbiter. This link is exactly
> what you are looking for:

> http://apr.apache.org/docs/apr-util/group___a_p_r___util___d ate.html#ga1

Except that link mirrors the current mod_perl documentation, and doesn't
mention RFC 2616 (and the GMT-only requirement) either. So if the mod_perl
doc is incorrect (or at least incomplete) so is that.

Re: APR::Date

am 18.03.2005 02:54:30 von Joe Schaefer

Malcolm J Harwood writes:

> On Wednesday 16 March 2005 11:12 pm, Joe Schaefer wrote:

[...]

>> The RFC is a guideline, not the final arbiter. This link is exactly
>> what you are looking for:
>
>> http://apr.apache.org/docs/apr-util/group___a_p_r___util___d ate.html#ga1
>
> Except that link mirrors the current mod_perl documentation, and
> doesn't mention RFC 2616 (and the GMT-only requirement) either. So
> if the mod_perl doc is incorrect (or at least incomplete) so is that.

Exactly, by having a reference to libaprutil in our docs,
you now know where to send your documentation patch so
it'll be of maximum benefit.

--
Joe Schaefer