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