Brian was using error-checking code of the form
(CASE ERROR ((ERRNO/INTR) ...) ...) But CASE doesn't evauate its keys, so this didn't work. I switched it to COND's. We should import my conditional macros, which includes an evaluating-key CASE. -Olin
This commit is contained in:
parent
975278b58b
commit
464f44f2a3
|
@ -463,16 +463,20 @@
|
|||
(let loop ()
|
||||
(receive (err nread)
|
||||
(reader sockfd flags s start end addr)
|
||||
(if err
|
||||
(case err
|
||||
((errno/intr) (loop))
|
||||
|
||||
(cond ((not err)
|
||||
(values (and (not (zero? nread)) nread)
|
||||
(make-socket-address from addr)))
|
||||
|
||||
((= err errno/intr) (loop))
|
||||
|
||||
; No forward-progess here.
|
||||
((errno/wouldblock errno/again) 0)
|
||||
((or (= err errno/wouldblock)
|
||||
(= err errno/again))
|
||||
0)
|
||||
|
||||
(else (errno-error err reader sockfd flags
|
||||
s start start end addr)))
|
||||
(values
|
||||
(and (not (zero? nread)) nread)
|
||||
(make-socket-address from addr))))))))
|
||||
s start start end addr))))))))
|
||||
|
||||
(define-foreign recv-substring!/errno
|
||||
(recv_substring (integer sockfd)
|
||||
|
@ -513,12 +517,11 @@
|
|||
(if (< i end)
|
||||
(receive (err nwritten)
|
||||
(writer sockfd flags s i end family addr)
|
||||
(if err
|
||||
(case err
|
||||
((errno/intr) (loop i))
|
||||
(else (errno-error err sockfd flags family addr
|
||||
s start i end writer)))
|
||||
(loop (+ i nwritten))))))))
|
||||
(cond ((not err) (loop (+ i nwritten)))
|
||||
((= err errno/intr) (loop i))
|
||||
(else (errno-error err sockfd flags family addr
|
||||
s start i end writer))))))))
|
||||
|
||||
|
||||
(define (send-message/partial socket s . args)
|
||||
(let-optionals args ((start 0) (end (string-length s)) (flags 0) (addr #f))
|
||||
|
@ -545,13 +548,11 @@
|
|||
(let loop ()
|
||||
(receive (err nwritten)
|
||||
(writer sockfd flags s start end family addr)
|
||||
(if err
|
||||
(case err
|
||||
((errno/intr) (loop))
|
||||
((errno/again errno/wouldblock) 0)
|
||||
(cond ((not err) nwritten)
|
||||
((= err errno/intr) (loop))
|
||||
((or (= err errno/again) (= err errno/wouldblock)) 0)
|
||||
(else (errno-error err sockfd flags family addr
|
||||
s start start end writer)))
|
||||
nwritten)))))
|
||||
s start start end writer)))))))
|
||||
|
||||
(define-foreign send-substring/errno
|
||||
(send_substring (integer sockfd)
|
||||
|
|
Loading…
Reference in New Issue