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

Re: Netscape and 304 response code bug



Hi,

Rainer Joswig was so kind as to send me the following modified write-time
function:

>(in-package :http)
>
>(define daylight-saving-time-p ()
>   (nth-value 7 (get-decoded-time)))
>
>(define write-time (&optional (universal-time (get-universal-time))
>                              (stream *standard-output*)
>                              (time-zone (www-utils:time-zone)))
>  "Print the full date, assuming GMT as the timeszone."
>  (multiple-value-bind (seconds minutes hours day month year weekday)
>                       (decode-universal-time (if (daylight-saving-time-p)
>                                                (+ universal-time 3600)
>                                                universal-time)
>                                              time-zone)
>    (with-string-for-null-stream (stream)
>      (write-string (www-utils:day-of-the-week-string weekday :short) stream)
>      (cond ((< day 10.)
>             (write-string ", 0" stream))
>            (t (write-string ", " stream)))
>      (write day :stream stream :base 10. :escape nil)
>      (write-char #\space stream)
>      (write-string (month-string month :short) stream)
>      (write-char #\space stream)
>      (write year :stream stream :base 10. :escape nil)
>      (write-char #\space stream)
>      (write-24-hour-time hours minutes seconds stream))))

The code actually solved my Netscape looping problem. (I actually changed the
definition of daylight-saving-time-p to take a time argument and pass it from
write-time (since it can be invoked with a time argument differing from now):

(define daylight-saving-time-p (&optional (universal-time (get-universal-time)))
   (nth-value 7 (decode-universal-time universal-time)))

and in write-time:

 (multiple-value-bind (seconds minutes hours day month year weekday)
                      (decode-universal-time (if (daylight-saving-time-p
universal-time) ;; changed
                                               (+ universal-time 3600)
                                               universal-time)
                                             time-zone)

Perhaps the sources can be updated with a fix incorporating these changes?

Hallvard

Hallvard Traetteberg
Sect. of Information Systems, SINTEF Informatics
P.O.Box 124 Blindern, N-0314 Oslo, Norway
Tlf: +47 2206 7983 or +47 2206 7300, Fax: +47 2206 7350
Email: Hallvard.Tretteberg@si.sintef.no