libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Date bug in header


From: John Popplewell
Subject: [libmicrohttpd] Date bug in header
Date: Mon, 5 May 2008 15:08:30 +0100
User-agent: Mutt/1.5.8i

Hi,

I was evaluating this very interesting looking library (running
fileserver_example) and just happened to look at the headers sent back
using wget -S and noticed that the year was wrong:

Connecting to digimate[192.168.0.240]:8888... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Content-Length: 18621
 3 Date: Mon, 05 May 0108 13:53:32 GMT
                     ^^^^

It seems that gmtime_r() returns the number of years since 1900 in the
now.tm_year field so I changed the relevant line in
src/daemon/connection.c get_date_string() to fix this:

...
        mons[now.tm_mon % 12],
        1900+now.tm_year, now.tm_hour, now.tm_min,
        now.tm_sec);
}
...

Now I get this, which looks better:

Connecting to digimate[192.168.0.240]:8888... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Content-Length: 18621
 3 Date: Mon, 05 May 2008 14:01:40 GMT
                     ^^^^

I checked-out the current SVN version before bothering you,

best regards,
John.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]