> According to Gilles Detillieux:
>
> According to Katherine Porter:
> > I'm in EST, and when I tried to crawl a TigerShark (see
> > http://www.directnic.com/about/products/tigershark.php) web server,
> > the request and response (htdig to the web server) communication looked
> > like this:
> ...
> > If-Modified-Since: Wed, 31 Dec 1969 19:00:00 EST
> ...
> > Apparently, this web server software has a problem with a year being
> > less than 1970. I realize that this seems very trivial because the web
> > server should convert EST to GMT by adding five hours (i.e. EST5EDT,
> > or -5 GMT) which would reveal that this is actually Thurs, 1 Jan 1970
> > 00:00:00 GMT -- but it does not.
> >
> > My proposed solution to this problem is to patch htnet/HtHTTP.cc, and
> > converting the _modification_time to GMT, via the function ToGMTime().
> > Here's my diff (-u):
> >
> > --- HtHTTP.cc.orig Fri Sep 21 00:44:22 2001
> > +++ HtHTTP.cc Fri Sep 21 00:41:47 2001
> > @@ -598,6 +598,7 @@
> > // the one we already own.
> >
> > if(_modification_time)
> > + _modification_time->ToGMTime();
> > cmd << "If-Modified-Since: " << _modification_time->GetRFC1123() <<
>"\r\n";
> >
> > ///////
> >
> > After this patch, everything seemed to work just fine. The
> > "If-Modified-Since" was converted to GMT, and the client's web server
> > successfully "dug". This is not to say that this was a bug with htdig,
> > however, I think that its always a good idea to talk dates in GMT when
> > it comes to headers. :-)
>
> There is no doubt at all that this is a bug. Actually it's two bugs.
> First, dates in HTTP headers must be in GMT/UTC. Secondly, there
> shouldn't be an If-Modified-Since put out if the date is set to the epoch.
> Your fix is a partial solution, but will break if _modification_time is
> a null pointer. (You need braces arount the two statements in the if.)
>
> I think this will fix both problems:
>
> if(_modification_time && *_modification_time > 0)
> {
> _modification_time->ToGMTime();
> cmd << "If-Modified-Since: " << _modification_time->GetRFC1123() << "\r\n";
> }
>
> --
Gilles - thanks for the braces. In my enthusiasm of "fixing" this problem, I forgot
them. However, your addition of "&& *_modification_time > 0" seems to bring things
back to the bug in testing. In htdig -vvvvv I get this in the Request segment:
If-Modified-Since: Wed, 31 Dec 1969 19:00:00 EST
Apparently, *_modification_time is equal to zero in this case. Would it not be safe
to assume that *_modification_time is not a null pointer if _modification_time has a
value? Pardon me if my question/comments seem hazy, it is 3:20 AM and I'm running on
barely four hours of rest from last evening.
[.kate]
___________________________________________________________________________
Visit http://www.visto.com.
Find out how companies are linking mobile users to the
enterprise with Visto.
_______________________________________________
htdig-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htdig-dev