*** empty log message ***
This commit is contained in:
parent
ddf13b9e3d
commit
846439590d
|
@ -68,3 +68,16 @@ int fbufcount(FILE* fs)
|
|||
{
|
||||
return(fs->_cnt);
|
||||
}
|
||||
|
||||
/* Returns true if there is no buffered data in stream FS
|
||||
** (or there is no buffering, period.)
|
||||
*/
|
||||
|
||||
int ibuf_empty(FILE *fs) {return fs->_cnt <= 0;}
|
||||
|
||||
|
||||
/* Returns true if the buffer in stream FS is full
|
||||
** (or there is no buffering, period).
|
||||
*/
|
||||
|
||||
int obuf_full(FILE *fs) {return fs->_cnt <= 0;}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; Networking for the Scheme Shell
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994-1995 by Brian D. Carlstrom.
|
||||
;;; Copyright (c) 1994 by Olin Shivers.
|
||||
|
||||
;;; Scheme48 implementation.
|
||||
|
@ -364,7 +364,7 @@
|
|||
(else
|
||||
(let ((s (make-string len)))
|
||||
(receive (nread from)
|
||||
(receive-message! socket flags s 0 len)
|
||||
(receive-message! socket s 0 len flags)
|
||||
(values
|
||||
(cond ((not nread) #f) ; EOF
|
||||
((= nread len) s)
|
||||
|
@ -372,6 +372,8 @@
|
|||
from)))))))
|
||||
|
||||
(define (receive-message! socket s . maybe-args)
|
||||
(if (not (string? s))
|
||||
(error "receive-message!: string expected")
|
||||
(receive (start end flags)
|
||||
(parse-optionals maybe-args 0 (string-length s) 0)
|
||||
(cond ((not (socket? socket))
|
||||
|
@ -380,13 +382,11 @@
|
|||
(integer? start)
|
||||
(integer? end)))
|
||||
(error "receive-message!: integer expected"))
|
||||
((not (string? s))
|
||||
(error "receive-message!: string expected"))
|
||||
(else
|
||||
(generic-receive-message! (socket->fdes socket) flags
|
||||
s start end
|
||||
recv-substring!/errno
|
||||
(socket:family socket))))))
|
||||
(socket:family socket)))))))
|
||||
|
||||
(define (generic-receive-message! sockfd flags s start end reader from)
|
||||
(if (bogus-substring-spec? s start end)
|
||||
|
@ -419,26 +419,30 @@
|
|||
(not (integer? len)))
|
||||
(error "receive-message/partial: integer expected"))
|
||||
(else
|
||||
(let* ((s (make-string len))
|
||||
(nread (receive-message!/partial socket flags s 0 len )))
|
||||
(let ((s (make-string len)))
|
||||
(receive (nread addr)
|
||||
(receive-message!/partial socket s 0 len flags)
|
||||
(values
|
||||
(cond ((not nread) #f) ; EOF
|
||||
((= nread len) s)
|
||||
(else (substring s 0 nread))))))))
|
||||
(else (substring s 0 nread)))
|
||||
addr)))))))
|
||||
|
||||
(define (receive-message!/partial socket s . maybe-args)
|
||||
(if (not (string? s))
|
||||
(error "receive-message!/partial: string expected")
|
||||
(receive (start end flags)
|
||||
(parse-optionals maybe-args 0 (string-length s) 0)
|
||||
(cond ((not (socket? socket))
|
||||
(error "receive-message!/partial: socket expected"))
|
||||
((not (integer? flags))
|
||||
(error "receive-message!/partial: integer expected"))
|
||||
((not (string? s))
|
||||
(error "receive-message!/partial: string expected"))
|
||||
(else
|
||||
(generic-receive-message!/partial (socket->fdes socket) flags
|
||||
(generic-receive-message!/partial (socket->fdes socket)
|
||||
flags
|
||||
s start end
|
||||
recv-substring!/errno
|
||||
(socket:family socket))))))
|
||||
(socket:family socket)))))))
|
||||
|
||||
(define (generic-receive-message!/partial sockfd flags s start end reader from)
|
||||
(if (bogus-substring-spec? s start end)
|
||||
|
@ -458,7 +462,7 @@
|
|||
s start start end addr)))
|
||||
(values
|
||||
(and (not (zero? nread)) nread)
|
||||
from)))))))
|
||||
(make-socket-address from addr))))))))
|
||||
|
||||
(define-foreign recv-substring!/errno
|
||||
(recv_substring (integer sockfd)
|
||||
|
@ -523,9 +527,7 @@
|
|||
s start end
|
||||
send-substring/errno
|
||||
(if addr (socket-address:family addr) 0)
|
||||
(and addr
|
||||
(socket-address:family
|
||||
addr)))))))
|
||||
(if addr (socket-address:address addr)))))))
|
||||
|
||||
(define (generic-send-message/partial sockfd flags s start end writer family addr)
|
||||
(if (bogus-substring-spec? s start end)
|
||||
|
@ -534,7 +536,6 @@
|
|||
s start end writer))
|
||||
|
||||
(if (= start end) 0 ; Vacuous request.
|
||||
(let ((addr (if addr (make-addr family) "")))
|
||||
(let loop ()
|
||||
(receive (err nwritten)
|
||||
(writer sockfd flags s start end family addr)
|
||||
|
@ -544,7 +545,7 @@
|
|||
((errno/again errno/wouldblock) 0)
|
||||
(else (errno-error err sockfd flags family addr
|
||||
s start start end writer)))
|
||||
nwritten))))))
|
||||
nwritten)))))
|
||||
|
||||
(define-foreign send-substring/errno
|
||||
(send_substring (integer sockfd)
|
||||
|
|
Loading…
Reference in New Issue