cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-3076529 ] Date Parsing is not RFC 822 compliant

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Mon, 27 Sep 2010 14:31:35 +0000

Bugs item #3076529, was opened at 2010-09-27 15:21
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3076529&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: bad behaviour
Status: Open
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Matt Ford (mattford63)
Assigned to: Daniel Stenberg (bagder)
Summary: Date Parsing is not RFC 822 compliant

Initial Comment:
Tested on Debian Squeeze, Curl version 7.21.0
RFC 822 as I read it shows that seconds are optional when specifying the date format. However when passing a date with a seconds field results in a -1 error. Some RSS feeds I use don't specify the seconds on there publish date. The attached file shows the bad behaviour.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2010-09-27 16:31

Message:
Ack.

I've tried with the patch that I'll show here and it seems to work. I'll
commit and push this within shortly:

--- a/lib/parsedate.c
+++ b/lib/parsedate.c
@@ -371,6 +371,12 @@ int Curl_parsedate(const char *date, time_t *output)
         /* time stamp! */
         date += 8;
       }
+ else if((secnum == -1) &&
+ (2 == sscanf(date, "%02d:%02d", &hournum, &minnum))) {
+ /* time stamp without seconds */
+ date += 5;
+ secnum = 0;
+ }
       else {
         val = (int)strtol(date, &end, 10);
 

----------------------------------------------------------------------

Comment By: Matt Ford (mattford63)
Date: 2010-09-27 15:23

Message:
That should read "passing a date *without* a seconds field". Poor bug
reporting that. :-)

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3076529&group_id=976
Received on 2010-09-27

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET