;;; -*- Mode:Lisp; Readtable:CL; Package:USER; Base:10; Patch-File:T -*-
;;; Patch file for System version 123.29
;;; Reason:
;;;  (:method tcp-buffered-stream :new-output-buffer) was returning NIL if the connection
;;;  is closed.  This is a no-no -- :tyo loops until a buffer is returned.  Should just
;;;  return a buffer and let the buffer be discarded by TCP.  Ditto for udp-stream.
;;; Written 6-Oct-87 17:30:15 by pld at site LMI Cambridge
;;; while running on Jack Flanders from band 2
;;; with Experimental System 123.28, Experimental Local-File 73.0, Experimental FILE-Server 22.0, Experimental Unix-Interface 11.0, Experimental Tape 18.0, Experimental KERMIT 34.0, Experimental ZMail 71.0, Experimental Lambda-Diag 15.0, microcode 1754, SDU Boot Tape 3.12, SDU ROM 8.



; From modified file DJ: L.NETWORK.IP-TCP.KERNEL; TCP-STREAM.LISP#36 at 6-Oct-87 17:30:20
#10R TCP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "TCP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; KERNEL; TCP-STREAM  "


(defmethod (tcp-buffered-stream :new-output-buffer) ()
  (declare (values buffer start end))
  (loop
    (cond (output-buffer-list
	   (return (values (pop output-buffer-list) 0 output-buffer-size)))
	  ((send self :handle-all-replies))
	  (t
	   (wait-for-reply socket)))))

))

; From modified file DJ: L.NETWORK.IP-TCP.KERNEL; UDP-STREAM.LISP#17 at 6-Oct-87 17:39:22
#10R UDP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "UDP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; KERNEL; UDP-STREAM  "

(defmethod (udp-buffered-stream :new-output-buffer) ()
  (declare (values buffer start end))
  (let ((buffer (send socket :allocate)))
    (values buffer 0 (array-length buffer))))

))
