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

[LW] SOCKET-SEND and SOCKET-RECEIVE should never return NIL (comes from raise-usock-err) (#62)

parent 2d9fc563
...@@ -598,9 +598,9 @@ ...@@ -598,9 +598,9 @@
n n
(let ((errno #-win32 (lw:errno-value) (let ((errno #-win32 (lw:errno-value)
#+win32 (wsa-get-last-error))) #+win32 (wsa-get-last-error)))
(if (zerop errno) (unless (zerop errno)
n (raise-usock-err errno socket-fd host))
(raise-usock-err errno socket-fd host))))))) 0)))))
(defmethod socket-receive ((socket datagram-usocket) buffer length &key timeout (max-buffer-size +max-datagram-packet-size+)) (defmethod socket-receive ((socket datagram-usocket) buffer length &key timeout (max-buffer-size +max-datagram-packet-size+))
"Receive message from socket, read-timeout is a float number in seconds. "Receive message from socket, read-timeout is a float number in seconds.
...@@ -662,9 +662,9 @@ ...@@ -662,9 +662,9 @@
:copy-foreign-object nil))) :copy-foreign-object nil)))
(let ((errno #-win32 (lw:errno-value) (let ((errno #-win32 (lw:errno-value)
#+win32 (wsa-get-last-error))) #+win32 (wsa-get-last-error)))
(if (zerop errno) (unless (zerop errno)
(values nil n 0 0) (raise-usock-err errno socket-fd))
(raise-usock-err errno socket-fd))))))))) (values nil n 0 0))))))))
(defmethod get-local-name ((usocket usocket)) (defmethod get-local-name ((usocket usocket))
(multiple-value-bind (multiple-value-bind
......
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