;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:10; Patch-File:T -*-
;;; Patch file for System version 124.50
;;; Reason:
;;;  In the :plist method for fs:ftp-file-stream-mixin, inside the with-lock
;;;  check to  see if the wholine got the plist for us.
;;; Written 11-Jun-88 15:06:31 by pld (Peter L. DeWolf) at site Gigamos Cambridge
;;; while running on Azathoth from band 1
;;; with Experimental System 124.49, Experimental Local-File 74.1, Experimental File-Server 23.1, Experimental Unix-Interface 12.0, Experimental ZMail 72.0, Experimental Tape 23.6, Experimental Lambda-Diag 16.1, microcode 1758, SDU Boot Tape 3.14, SDU ROM 8.



; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP-ACCESS.LISP#57 at 11-Jun-88 15:06:33
#10R FILE-SYSTEM#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "FILE-SYSTEM")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP-ACCESS  "

(defmethod (ftp-file-stream-mixin :plist) (&aux p)
  (or (and (variable-boundp si:property-list) si:property-list)
      ;;Property-list already initialized
      (if (and (null si:current-process) property-list-lock)
	  ;;We are the scheduler updating the wholine and somebody else is getting the property list
	  nil
	(with-lock (property-list-lock :whostate "Property List Lock")
	  (cond ((and (variable-boundp si:property-list) si:property-list)
		 ;;Wholine got it for us while we waited for the lock
		 )
		((not support-plistp)
		 ;;Can't get property list -- either raw-directory list or we've tried and failed.
		 nil)
		((setq support-plistp nil)	;For effect only
		 ;; If we dont set this to NIL then the interaction of the stack of TV:WHO-LINE file streams
		 ;; will cause failure.  Doing the OPEN is ok, and causes a new stream (:Raw-directory-list t)
		 ;; to be seen in the who-line, (which unfortunately *looks* like the present one, but is not)
		 ;; but when that stream is closed it removes itself, causes the previous stream, *us* to be seen,
		 ;; and to be sent yet another :LENGTH message, and we get a recursive call to this code.
		 nil)
		((not (ftp-directory-line-parserp (send host-unit :host)))
		 ;;No parser for this host -- can't get property list
		 nil)
		((setq p (or probe-stream (open truename :direction nil)))
		 ;;We have a probe stream -- copy its property list
		 (setq truename (send p :truename))
		 (setq si:property-list (plist p)))
		(t
		 ;;No probe stream??
		 nil))))))

))
