[usocket-devel] usocket 0.2.3 bug (openmcl 1.0/darwin32 backend)

kevin montuori montuori at ignavus.info
Sat Jan 13 14:39:30 UTC 2007


hi -- first, thanks for a very useful library.

i've run across a bug in the usocket 0.2.3 package, specifically in
backend/openmcl.lisp.  the openmcl-socket:socket-connect function
takes exactly one argument, socket.[1] the usocket code provides two
arguments, socket and :element-type.

it appears (networking is not necessarily my strong point!) that with
sockets of type :stream (i.e., not :datagram) the format is always
bivalent, making the :element-type distinction inconsequential.[2]

i've provided diff -c output[3] for the fix that i required.

please excuse me if this has already been reported (or fixed) already,
i didn't see mention of it.

cheers.
k.


[1] http://openmcl.clozure.com/Doc/index.html#SOCKET_002dCONNECT
[2] http://openmcl.clozure.com/Doc/index.html#Overview-_003c3_003e
[3] 

*** openmcl.lisp.orig   Sat Jan 13 09:18:21 2007
--- openmcl.lisp        Sat Jan 13 09:25:42 2007
***************
*** 45,54 ****
       (let ((mcl-sock (openmcl-socket:make-socket :remote-host
                                                   (host-to-hostname host)
                                                   :remote-port port)))
!         (openmcl-socket:socket-connect mcl-sock
!                                        :element-type (if (subtypep element-type
!                                                                    'character)
!                                                          :text :binary))
          (make-stream-socket :stream mcl-sock :socket mcl-sock))))
  
  (defmethod socket-close ((usocket usocket))
--- 45,51 ----
       (let ((mcl-sock (openmcl-socket:make-socket :remote-host
                                                   (host-to-hostname host)
                                                   :remote-port port)))
!         (openmcl-socket:socket-connect mcl-sock)
          (make-stream-socket :stream mcl-sock :socket mcl-sock))))
  
  (defmethod socket-close ((usocket usocket))


-- 
kevin montuori
montuori at gmail.com

this signature no verb.



More information about the usocket-devel mailing list