[drakma-devel] Several fixes and workarounds (Was: New version 0.5.5)

Edi Weitz edi at agharta.de
Thu Feb 8 14:45:10 UTC 2007


On Tue, 06 Feb 2007 01:46:02 +0100, Edi Weitz <edi at agharta.de> wrote:

> I've now done a full run through the test URLs you sent and they
> provide for a lot of interesting problematic cases.  I'll update
> Drakma and probably Chunga with bugfixes and/or workarounds in the
> next days.

OK, see the new releases of Drakma and Chunga.  I can now run Drakma
(tested on LWW 5.0.1) through Chris Dean's 1600+ test cases with only
very few warnings and errors.  These are:

1. Charsets like GB2312 that FLEXI-STREAMS doesn't know.

2. Headers sent by the server which are really corrupt.

3. Network-related errors like "Unknown host".

4. Five cases of "End of file while reading ...".

I'm only concerned about #4, but unfortunately these aren't
reproducible.  I'll see what I can find out, but if someone has an
idea, please step forward.

FWIW, this is the function I used for testing:

  (defun simple-get (url)
    (handler-case 
        (let ((puri:*strict-parse* nil)
              (flex:*provide-use-value-restart* t)
              (flex:*substitution-char* #\?))
          (multiple-value-bind (stream code)
              (drakma:http-request url
                                   :cookie-jar (make-instance 'drakma:cookie-jar)
                                   :want-stream t)
            (unwind-protect 
                (and stream (eql code 200)
                     (with-output-to-string (out)
                       (do ((ch (read-char stream nil :eof) 
                                (read-char stream nil :eof)))
                           ((not (characterp ch)))
                         (princ ch out))))
              (when stream
                (ignore-errors (close stream :abort t))))))
      (error (condition)         
        (format t "~&Error (~A): ~A~%%" url condition)
        nil)))

Edi.



More information about the Drakma-devel mailing list