Commit 2d9fc563 authored by Chun Tian (binghe)'s avatar Chun Tian (binghe)
Browse files

[LW] socket-accept returns NIL if the underlying socket is NIL and the error...

[LW] socket-accept returns NIL if the underlying socket is NIL and the error (somehow) is not captured
parent ade7ede9
0.8.4:
* [LW] SOCKET-ACCEPT now raises CONNECTION-ABPRTED-ERROR instead of INVALID-SOCKET-ERROR if the underlying socket got from comm::accept-connection-to-socket or comm::get-fd-from-socket is NIL. (#63)
0.8.3: (Dec 23, 2019) 0.8.3: (Dec 23, 2019)
* New experimental backend: Mezzano (contributed by Bruno Cichon, #51) * New experimental backend: Mezzano (contributed by Bruno Cichon, #51)
......
...@@ -491,21 +491,19 @@ ...@@ -491,21 +491,19 @@
#-win32 #-win32
(comm::get-fd-from-socket (socket usocket)))) (comm::get-fd-from-socket (socket usocket))))
(stream (when socket (stream (when socket
(make-instance 'comm:socket-stream (make-instance 'comm:socket-stream
:socket socket :socket socket
:direction :io :direction :io
:element-type (or element-type :element-type (or element-type
(element-type usocket)))))) (element-type usocket))))))
#+win32 #+win32
(when socket (when socket
(setf (%ready-p usocket) nil)) (setf (%ready-p usocket) nil))
;; It is possible that socket is NIL. Previously the call of make-stream-socket ;; It is possible that socket is NIL. Previously the call of make-stream-socket
;; raised a usocket:invalid-socket-error, now we let it raise ;; raised a usocket:invalid-socket-error
;; connection-aborted-error instead. (#63) (when socket
(if socket (make-stream-socket :socket socket :stream stream))))
(make-stream-socket :socket socket :stream stream)
(error 'connection-aborted-error))))
;; Sockets and their streams are different objects ;; Sockets and their streams are different objects
;; close the stream in order to make sure buffers ;; close the stream in order to make sure buffers
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment