[cl-plus-ssl-devel] CL+SSL and stream-write-sequence

Anton Vodonosov avodonosov at yandex.ru
Tue Mar 19 10:44:53 UTC 2013


19.03.2013, 14:18, "Hans Hübner" <hans.huebner at gmail.com>:
> Hi Anton,
> Stas Boukarev just reported that DRAKMA does not work with the latest version of CL+SSL from (git://gitorious.org/cl-plus-ssl/cl-plus-ssl.git).  The issue is that DRAKMA passes non-simple arrays to WRITE-SEQUENCE, which makes CL+SSL fail.
>
> I have pondered fixing this problem on the application level, but that is not easy (buffers with fill pointers are used in several places) and it also does not appear to be the right thing.  Instead, it would be better if CL+SSL dispatched on the sequence type and applied the optimized version simple arrays only if applicable.
>
> What do you think?  Do you want me to supply a patch?  It would be rather bad if DRAKMA's SSL support would be broken in quicklisp, so I hope we can resolve this before the next release.
>
> Thanks,
> Hans

Hans, the patch would be very welcome.

I agree, that any kind of sequence should be possible to pass
to write-sequence, read-sequence, and cl+ssl should handle this.

I think if the sequence is not a simple array, cl+ssl can copy it into a simple-array.

For you information, what was changed in cl+ssl:

  (defclass ssl-stream
      (fundamental-binary-input-stream
       fundamental-binary-output-stream
       trivial-gray-stream-mixin)

was changed to 

  (defclass ssl-stream
      (trivial-gray-stream-mixin
       fundamental-binary-input-stream
       fundamental-binary-output-stream)

i.e. trivial-gray-stream-mixin was put into the beginning in parent classes list.

Without this, due to the way how trivial-gray-streams worked,
when we call cl:write-sequence and cl:read-sequence, 
cl+ssl:stream-write-sequence and cl+ssl:stream-read-sequence were not called at all.
Instead default methods were used, which just write/read byte by byte via
cl+ssl:stream-write-byte cl+ssl:stream-read-byte.

Following to the fix of cl+ssl, I also fixed trivial-gray-stream so that
tirivial-gray-streams-mixin become unnecessary and stream-write-sequence
is always called.

Best regards,
- Anton




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