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

[LW] SOCKET-ACCEPT now raises CONNECTION-ABPRTED-ERROR instead of...

[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)
parent 800d64f0
0.8.3:
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)
* New experimental backend: Mezzano (contributed by Bruno Cichon, #51)
* Bugfix: WAIT-FOR-INPUT fails to honor :ready-only t (#57, thanks to @Reepca for reporting this issue)
......
......@@ -477,8 +477,8 @@
(error 'address-in-use-error)))))
(make-stream-server-socket sock :element-type element-type)))
;; Note: COMM::GET-FD-FROM-SOCKET contains addition socket wait operations, which
;; should NOT be applied on socket FDs who have already been called on W-F-I,
;; Note: COMM::GET-FD-FROM-SOCKET contains additional socket-wait operations, which
;; should NOT be applied to socket FDs which has already been called on W-F-I,
;; so we have to check the %READY-P slot to decide if this waiting is necessary,
;; or SOCKET-ACCEPT will just hang. -- Chun Tian (binghe), May 1, 2011
......@@ -490,15 +490,22 @@
(comm::get-fd-from-socket (socket usocket)))
#-win32
(comm::get-fd-from-socket (socket usocket))))
(stream (make-instance 'comm:socket-stream
:socket socket
:direction :io
:element-type (or element-type
(element-type usocket)))))
(stream (when socket
(make-instance 'comm:socket-stream
:socket socket
:direction :io
:element-type (or element-type
(element-type usocket))))))
#+win32
(when socket
(setf (%ready-p usocket) nil))
(make-stream-socket :socket socket :stream stream)))
;; 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
;; connection-aborted-error instead. (#63)
(if socket
(make-stream-socket :socket socket :stream stream)
(error 'connection-aborted-error))))
;; Sockets and their streams are different objects
;; close the stream in order to make sure buffers
......@@ -509,7 +516,7 @@
(defmethod socket-close ((usocket usocket))
(with-mapped-conditions (usocket)
(comm::close-socket (socket usocket))))
(comm::close-socket (socket usocket))))
(defmethod socket-close :after ((socket datagram-usocket))
"Additional socket-close method for datagram-usocket"
......
......@@ -88,7 +88,6 @@ been implemented yet."))
(:documentation "Condition raised when there's no other - more applicable -
condition available."))
;; Mass define and export our errors
(define-usocket-condition-classes
(address-in-use-error
......
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