[Ecls-list] [usocket-devel] ECL problem
Chun Tian
binghe.lisp at gmail.com
Sat Oct 17 18:50:13 UTC 2009
Hi, Juanjo
Thanks for taking my patch. I spent a little more time on checking
ECL's "contrib/sockets/sockets.lisp", and it seems that things are not
that serious as my first view. Only two buggy sockopt related
functions are found:
[Bug Description]
* GET-SOCKOPT-BOOL returns wrong value (always T or throw a error)
I've explained the reason (variable of actual value is dropped).
* SET-SOCKOPT-BOOL returns wrong value (always T or throw a error)
I believe this is a typo.
[Affected public interfaces]
SOCKOPT-REUSE-ADDRESS, SOCKOPT-KEEP-ALIVE, SOCKET-DONT-ROUTE, SOCKET-
LINGER, SOCKOPT-REUSE-PORT and SOCKOPT-TCP-NODELAY. (Package SB-BSD-
SOCKETS)
[Solution]
I've made a new, small patch (as in attach) to "sockets.lisp" which
fixed all above issues and now ECL behaves exactly the same as SBCL
when accessing above socket options:
> (setq socket (make-instance 'sb-bsd-sockets:inet-
socket :type :stream :protocol :tcp))
#<SB-BSD-SOCKETS:INET-SOCKET descriptor 3 4320793344>
> (sb-bsd-sockets::sockopt-tcp-nodelay socket)
NIL
> (setf (sb-bsd-sockets::sockopt-tcp-nodelay socket) t)
T
> (sb-bsd-sockets::sockopt-tcp-nodelay socket)
T
For the original bug which Leslie P. Polzer report to USOCKET project,
it's also fixed without touching USOCKET source code (if this new
patch applied), I believe.
Regards,
Chun Tian (binghe)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-and-set-sockopt-bool.patch
Type: application/octet-stream
Size: 907 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20091018/1c02fdc1/attachment.obj>
-------------- next part --------------
? 2009-10-18?1:58? Juan Jose Garcia-Ripoll ???
> 2009/10/17 Chun Tian <binghe.lisp at gmail.com>:
>> For a summary, I'll suggest Juanjo merge my version first (or
>> Mattew's
>> version with the number "6" replaced to "IPPROTO_TCP"). I'll see
>> how far I
>> can go from now on.
>>
>
> Thanks a lot for your help in debugging this and the other problems!
>
> I have just committed your patch --it also has the advantage that the
> level is explicit, just like in SBCL's code---. It is available in
> both the GIT and CVS repositories.
>
> Juanjo
>
> --
> Instituto de F?sica Fundamental, CSIC
> c/ Serrano, 113b, Madrid 28006 (Spain)
> http://juanjose.garciaripoll.googlepages.com
More information about the ecl-devel
mailing list