diff -ruN fnord-1.10-20100519fwb/httpd.c fnord-1.10-20100519fwb_2/httpd.c --- fnord-1.10-20100519fwb/httpd.c 2010-05-19 19:07:50.000000000 +0200 +++ fnord-1.10-20100519fwb_2/httpd.c 2010-05-19 19:03:43.000000000 +0200 @@ -848,6 +848,7 @@ struct tm x; int i; unsigned long tmp; + time_t tnull; if (!c) return (time_t)-1; /* "Sun, 06 Nov 1994 08:49:37 GMT", * "Sunday, 06-Nov-94 08:49:37 GMT" and @@ -883,7 +884,9 @@ if (parsetime(c,&x)) return (time_t)-1; done: x.tm_wday=x.tm_yday=x.tm_isdst=0; - return mktime(&x); + /* return with timezone offset added */ + tnull = 0; + return mktime(&x)-mktime(gmtime(&tnull)); } static void redirectboilerplate() { @@ -938,7 +941,10 @@ /* see if the peer accepts MIME type */ /* see if the document has been changed */ ims=parsedate(header(buf,buflen,"If-Modified-Since")); - if (ims!=(time_t)-1 && st.st_mtime<=ims) { retcode=304; goto bad; } + if (ims!=(time_t)-1) { + /* 2nd compare is a dirty hack to overcome linux dst limits */ + if ((st.st_mtime<=ims) || (st.st_mtime == ims + 3600)) { retcode=304; goto bad; } + } rangestart=0; rangeend=st.st_size; if ((accept=header(buf,buflen,"Range"))) { /* format: "bytes=17-23", "bytes=23-" */