[usocket-devel] clisp: small patch and result of test

Erik Huelsmann ehuels at gmail.com
Tue Sep 4 22:55:55 UTC 2007


I've just committed a variant to the change you suggest below. Since I
don't want to change global state, I attached the foreign-language
specifier to the declaration of of get-host-name itself.

I hope that fixes the problem equally well.

bye,

Erik.

On 8/27/07, Yaroslav Kavenchuk <kavenchuk at tut.by> wrote:
> clisp from CVS head, win32
>
> Patch for remove some warnings:
>
> --- backend/clisp.lisp     Wed Jul 25 22:28:12 2007
> +++ backend/clisp.lisp  Mon Aug 27 23:00:33 2007
> @@ -5,6 +5,7 @@
>
>  (in-package :usocket)
>
> +(FFI:DEFAULT-FOREIGN-LANGUAGE :STDC)
>
>  ;; utility routine for looking up the current host name
>  (FFI:DEF-CALL-OUT get-host-name-internal
> @@ -73,7 +74,7 @@
>                             (element-type 'character))
>    ;; clisp 2.39 sets SO_REUSEADDRESS to 1 by default; no need to
>    ;; to explicitly turn it on; unfortunately, there's no way to turn it
> off...
> -  (declare (ignore reuseaddress reuse-address))
> +  (declare (ignore reuseaddress reuse-address reuse-address-supplied-p))
>    (let ((sock (apply #'socket:socket-server
>                       (append (list port
>                                     :backlog backlog)
>
>
>
> Result of test:
>
> Test USOCKET-TEST::SOCKET-FAILURE.1 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS
> ('USOCKET:NETWORK-UNREACHABLE-ERROR NIL)
>  (USOCKET:SOCKET-CONNECT 2130706432 USOCKET-TEST::+UNUSED-LOCAL-PORT+)
> :UNREACH)
> Expected value: NIL
> Actual value: #<USOCKET:ADDRESS-NOT-AVAILABLE-ERROR #x19F191C9>.
>
> Test USOCKET-TEST::SOCKET-CONNECT.1 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT "common-lisp.net" 80)))
>   (UNWIND-PROTECT (TYPEP USOCKET-TEST::SOCK 'USOCKET:USOCKET)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected value: T
> Actual value: #<USOCKET:INVALID-ARGUMENT-ERROR #x19F19871>.
>
> Test USOCKET-TEST::SOCKET-CONNECT.2 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT
> USOCKET-TEST::+COMMON-LISP-NET+ 80)))
>   (UNWIND-PROTECT (TYPEP USOCKET-TEST::SOCK 'USOCKET:USOCKET)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected value: T
> Actual value: #<USOCKET:HOST-UNREACHABLE-ERROR #x19F198D9>.
>
> Test USOCKET-TEST::SOCKET-CONNECT.3 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT
> (USOCKET:HOST-BYTE-ORDER USOCKET-TEST::+COMMON-LISP-NET+) 80)))
>   (UNWIND-PROTECT (TYPEP USOCKET-TEST::SOCK 'USOCKET:USOCKET)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected value: T
> Actual value: #<USOCKET:HOST-UNREACHABLE-ERROR #x19F19955>.
>
> Test USOCKET-TEST::SOCKET-STREAM.1 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT "common-lisp.net" 80)))
>   (UNWIND-PROTECT
>    (PROGN (FORMAT (USOCKET:SOCKET-STREAM USOCKET-TEST::SOCK) "GET /
> HTTP/1.0~A~A~A~A" #\Return #\Newline #\Return #\Newline)
>     (FORCE-OUTPUT (USOCKET:SOCKET-STREAM USOCKET-TEST::SOCK)) (READ-LINE
> (USOCKET:SOCKET-STREAM USOCKET-TEST::SOCK)))
>    (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected values: "HTTP/1.1 200 OK"
>                  NIL
> Actual value: #<USOCKET:INVALID-ARGUMENT-ERROR #x19F19955>.
>
> Test USOCKET-TEST::SOCKET-NAME.1 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT
> USOCKET-TEST::+COMMON-LISP-NET+ 80)))
>   (UNWIND-PROTECT (USOCKET:GET-PEER-ADDRESS USOCKET-TEST::SOCK)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected value: #(80 68 86 115)
> Actual value: #<USOCKET:HOST-UNREACHABLE-ERROR #x19F19955>.
>
> Test USOCKET-TEST::SOCKET-NAME.2 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT
> USOCKET-TEST::+COMMON-LISP-NET+ 80)))
>   (UNWIND-PROTECT (USOCKET:GET-PEER-PORT USOCKET-TEST::SOCK)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected value: 80
> Actual value: #<USOCKET:HOST-UNREACHABLE-ERROR #x19F19955>.
>
> Test USOCKET-TEST::SOCKET-NAME.3 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT
> USOCKET-TEST::+COMMON-LISP-NET+ 80)))
>   (UNWIND-PROTECT (USOCKET:GET-PEER-NAME USOCKET-TEST::SOCK)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected values: #(80 68 86 115)
>                  80
> Actual value: #<USOCKET:HOST-UNREACHABLE-ERROR #x19F19955>.
>
> Test USOCKET-TEST::SOCKET-NAME.4 failed
> Form:
> (USOCKET-TEST::WITH-CAUGHT-CONDITIONS (NIL NIL)
>  (LET ((USOCKET-TEST::SOCK (USOCKET:SOCKET-CONNECT
> USOCKET-TEST::+COMMON-LISP-NET+ 80)))
>   (UNWIND-PROTECT (USOCKET:GET-LOCAL-ADDRESS USOCKET-TEST::SOCK)
> (USOCKET:SOCKET-CLOSE USOCKET-TEST::SOCK))))
> Expected value: #(192 168 1 65)
> Actual value: #<USOCKET:HOST-UNREACHABLE-ERROR #x19F19955>.
>
> 9 out of 15 total tests failed: USOCKET-TEST::SOCKET-FAILURE.1,
>    USOCKET-TEST::SOCKET-CONNECT.1, USOCKET-TEST::SOCKET-CONNECT.2,
>    USOCKET-TEST::SOCKET-CONNECT.3, USOCKET-TEST::SOCKET-STREAM.1,
>    USOCKET-TEST::SOCKET-NAME.1, USOCKET-TEST::SOCKET-NAME.2,
>    USOCKET-TEST::SOCKET-NAME.3, USOCKET-TEST::SOCKET-NAME.4.
>
> Debug it?
>
> --
> WBR, Yaroslav Kavenchuk.
> _______________________________________________
> usocket-devel mailing list
> usocket-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/usocket-devel
>



More information about the usocket-devel mailing list