call select in connect only on EINPROGRESS, loop on other errors
(which should not happend anyway according to POSIX).
This commit is contained in:
parent
bcd64a2b3a
commit
8900f05fd2
|
@ -228,7 +228,7 @@
|
|||
"connect: trying to connect socket to incompatible address ~s"
|
||||
name))
|
||||
((and (= family address-family/unix)
|
||||
; save space for \0
|
||||
; save space for \0
|
||||
(> (string-length (socket-address:address name)) 107))
|
||||
(error "connect: filename too long" name))
|
||||
(else
|
||||
|
@ -239,9 +239,9 @@
|
|||
(socket:family sock)
|
||||
(socket-address:address name))))
|
||||
(if (car error?.einprogress?)
|
||||
(begin
|
||||
(select '#() (vector (socket:outport sock)) '#())
|
||||
(if (cdr error?.einprogress?)
|
||||
(if (cdr error?.einprogress?)
|
||||
(begin
|
||||
(select '#() (vector (socket:outport sock)) '#())
|
||||
;; If connect returned EINPROGRESS, we can check
|
||||
;; it's success after the next success with getsockopt
|
||||
(let ((val (socket-option sock
|
||||
|
@ -252,8 +252,8 @@
|
|||
(errno-msg val)
|
||||
%connect
|
||||
sock
|
||||
name)))
|
||||
(loop))))))))))))
|
||||
name))))
|
||||
(loop)))))))))))
|
||||
|
||||
(import-os-error-syscall %connect (sockfd family name) "scheme_connect")
|
||||
|
||||
|
|
Loading…
Reference in New Issue