[cl-plus-ssl-devel] Possible bug in test-https-server (2008-11-04)

David Lichteblau david at lichteblau.com
Mon Jan 19 16:39:23 UTC 2009


Hi,

(sorry for the delay.  I saw the original question on the openmcl list
and here, but I'm not subscribed to either list usually)

Quoting Anton Vodonosov (avodonosovatyandex.ru):
> I am not the original author, just happen to have write access to the
> repository, therefore can't be 100% sure that it is not intentional
> (esp. taking into account ccl:make-socket call in the example.lisp,
> that allows to suppose that cl+ssl was developed on CCL).

As far as I am concerned, the current test suite is really in test.lisp,
not examples.lisp.  test.lisp should pass on both SBCL and CCL.

I agree that it would be better if examples.lisp worked though. :-)

> But it seems to be an error, closing ssl wrapper before wrapped socket
> is reasonable, moreover you reported that it works only that
> way on CCL.
> 
> Therefore I committed this change (for both test-https-client
> and test-https-server).

Thanks, that seems more reasonable.

However, the use of cl+ssl:stream-fd is not the recommended approach
these days.  You can just pass the stream object directly as an
argument, and if :unwrap-streams-p is true (which is the default), it
will:

  * unwap the file descriptor out of the stream automatically

  * close the stream argument properly when our stream object is closed

  * obey per-stream deadlines on CCL and SBCL
    (This last item is really why I invented the new API, but it's
    easier to use in general.)

Attached at patch that is untested, but illustrates how it *should* work
in theory.  (Please test; if it fails, it's a bug.)


Note that both Hunchentoot and Drakma support CL+SSL (and still use the
old-style STREAM-FD approach), so if you (John) are looking for
examples, try Hunchentoot perhaps.

As for "does anyone use CL+SSL on CCL", at some point Hans Huebner was
using it for a major project, which was also the reason for my changes
last year.


d.




More information about the cl-plus-ssl-devel mailing list