[usocket-cvs] r489 - usocket/trunk/backend

Hans Hübner hhubner at common-lisp.net
Mon Feb 9 10:08:06 UTC 2009


Author: hhubner
Date: Mon Feb  9 10:08:05 2009
New Revision: 489

Log:
In CCL, guard against REMOTE-HOST returning nil (which will happen for
closed sockets).


Modified:
   usocket/trunk/backend/openmcl.lisp

Modified: usocket/trunk/backend/openmcl.lisp
==============================================================================
--- usocket/trunk/backend/openmcl.lisp	(original)
+++ usocket/trunk/backend/openmcl.lisp	Mon Feb  9 10:08:05 2009
@@ -123,10 +123,14 @@
     (close (socket usocket))))
 
 (defmethod get-local-address ((usocket usocket))
-  (hbo-to-vector-quad (openmcl-socket:local-host (socket usocket))))
+  (let ((address (openmcl-socket:local-host (socket usocket))))
+    (when address
+      (hbo-to-vector-quad address))))
 
 (defmethod get-peer-address ((usocket stream-usocket))
-  (hbo-to-vector-quad (openmcl-socket:remote-host (socket usocket))))
+  (let ((address (openmcl-socket:remote-host (socket usocket))))
+    (when address
+      (hbo-to-vector-quad address))))
 
 (defmethod get-local-port ((usocket usocket))
   (openmcl-socket:local-port (socket usocket)))




More information about the usocket-cvs mailing list