According to Katherine Porter:
> According to Gilles Detillieux:
> > 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
I'm at a loss to explain this. If you did indeed add the braces between
the ToGMTime and cmd << parts, as above, then it should always put out the
If-Modified-Since in GMT, regardless of whether the condition is correct
or not. However, if you changed the condition as above, but forgot to
add the braces, I think that would cause the behaviour you describe.
Is it possible that's what you did?
> 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.
...
> How about:
>
> if (_modification_time != NULL)
Well, I trust you've now had some sleep and can tackle this refreshed
and alert. The use of NULL is apparently a C-ism, and not a C++-ism,
where in C++ the recomendation is to compare to 0. The first part
of my recommended condition, which was Gabriele's original condition,
is just that...
if(_modification_time && *_modification_time > 0)
So, if _modification_time is null, i.e. 0, it won't do anything more,
including the second part after the &&. The second part of the
condition dereferences the pointer to get at the HtDateTime object
itself (having confirmed before the pointer is set). The > operator,
between a HtDateTime object and an int, is supposed to compare the
time_t value of the object to the int (0). So, I'm pretty sure this
is the right condition. A time_t value of 0 essentially means htdig
doesn't know the real modification time of the document in the database,
so it should ask the server for the document unconditionally, i.e. with
no If-Modified-Since header. If the time_t value is > 0, then it's safe
to assume the modification date is known, and so only then should htdig
put out this header.
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
_______________________________________________
htdig-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htdig-dev