anchor.diff:            t
             (restart-case
                 (error 'ssh-bad-hostkey
  -					 :reason host-key-status
  -					 :key (session-hostkey-fingerprint (session ssh)))
  -			(accept () t)
  -			(drop () nil)
  -			(accept-once  (&optional (comment ""))
  -			  (progn
  -				(known-hosts-add known-hosts (ssh-host+port-format ssh) host-key
  -								 :comment comment)
  -				t))
  -			(accept-always (&optional (comment ""))
  -			  (progn
  -				(known-hosts-add known-hosts (ssh-host+port-format ssh) host-key
  -								 :comment comment)
  -				(known-hosts-writefile known-hosts (hosts-db ssh))
  -				t)))))))
  +           :reason host-key-status
  +           :key (session-hostkey-fingerprint (session ssh)))
  +      (accept () t)
  +      (drop () nil)
  +      (accept-once  (&optional (comment ""))
  +        (progn
  +        (known-hosts-add known-hosts (ssh-host+port-format ssh) host-key
  +                 :comment comment)
  +        t))
  +      (accept-always (&optional (comment ""))
  +        (progn
  +        (known-hosts-add known-hosts (ssh-host+port-format ssh) host-key
  +                 :comment comment)
  +        (known-hosts-writefile known-hosts (hosts-db ssh))
  +        t)))))))
   
   (defmethod authentication-methods ((ssh ssh-connection) (login string))
     (session-auth-methods-list (session ssh) login))
   
   (defmethod authentication :around ((ssh ssh-connection) (auth auth-data))
     (if (auth-passed ssh)
  -	  t
  -	  (if (ssh-verify-session ssh)
  -		  (setf (auth-passed ssh)
  -				(eq
  -				 (call-next-method) :error-none)))))
  +    t
  +    (if (ssh-verify-session ssh)
  +      (setf (auth-passed ssh)
  +        (eq
  +         (call-next-method) :error-none)))))
   
   (defmethod authentication ((ssh ssh-connection) (auth auth-password))
     (user-auth-password (session  ssh)
  -					  (login    auth)
  -					  (password auth)))
  +            (login    auth)
  +            (password auth)))
   
   (defclass auth-publickey (auth-data)
     ((public-key  :type     string
  -				:initarg  :public-key
  -				:initform "id_rsa.pub"
  -				:accessor public-key)
  +                :initarg  :public-key
  +                :initform "id_rsa.pub"
  +                :accessor public-key)
      (private-key :type     string
  -				:initarg  :private-key
  -				:initform "id_rsa"
  -				:accessor private-key)
  +                :initarg  :private-key
  +                :initform "id_rsa"
  +                :accessor private-key)
      (password    :type     string
  -				:initarg  :password
  -				:initform ""
  -				:accessor password)))
  +                :initarg  :password
  +                :initform ""
  +                :accessor password)))
   
   (defmethod authentication ((ssh ssh-connection) (auth auth-publickey))
     (with-slots (login public-key private-key password) auth
  -	(user-auth-publickey (session ssh)
  -						 login public-key private-key password)))
  +  (user-auth-publickey (session ssh)
  +             login public-key private-key password)))
   
   (defclass auth-agent (auth-data) ())
   
   (defmethod authentication ((ssh ssh-connection) (auth auth-agent))
     (let ((agent (agent-init (session ssh)))
  -		(username (login auth)))
  -	(unwind-protect
  -		 (if (and agent
  -				  (eq (agent-connect agent)
  -					  :error-none))
  -			 (let ((next-identity (agent-identities-iterator agent)))
  -			   (when next-identity
  -				 (with-foreign-string (fs-username username)
  -				   (loop for identity = (funcall next-identity)
  -					  while identity do
  -						(if (eq
  -							 (%agent-userauth agent fs-username identity)
  -							 :ERROR-NONE)
  -							(return t))))))
  -			 (throw-last-error (session ssh)))
  -	  (when agent
  -		(agent-free agent)))))
  +    (username (login auth)))
  +  (unwind-protect
  +     (if (and agent
  +          (eq (agent-connect agent)
  +            :error-none))
  +       (let ((next-identity (agent-identities-iterator agent)))
  +         (when next-identity
  +         (with-foreign-string (fs-username username)
  +           (loop for identity = (funcall next-identity)
  +            while identity do
  +            (if (eq
  +               (%agent-userauth agent fs-username identity)
  +               :ERROR-NONE)
  +              (return t))))))
  +       (throw-last-error (session ssh)))
  +    (when agent
  +    (agent-free agent)))))
   
   (defun make-publickey-auth (login directory private-key-name &optional (password ""))
     (let ((private-key
  -		 (namestring (make-pathname :directory directory
  -									:name private-key-name)))
  -		(public-key
  -		 (namestring (make-pathname :directory directory
  -									:name private-key-name
  -									:type "pub"))))
  -	(make-instance 'auth-publickey
  -				   :login       login
  -				   :public-key  public-key
  -				   :private-key private-key
  -				   :password    password)))
  +         (namestring (make-pathname :directory directory
  +                                    :name private-key-name)))
  +        (public-key
  +         (namestring (make-pathname :directory directory
  +                                    :name private-key-name
  +                                    :type "pub"))))
  +    (make-instance 'auth-publickey
  +                   :login       login
  +                   :public-key  public-key
  +                   :private-key private-key
  +                   :password    password)))
   
   (defun make-agent-auth (login)
     (make-instance 'auth-agent
  -				 :login login))
  +                 :login login))
   
   (defun make-password-auth (login password)
     (make-instance 'auth-password
  -				 :login    login
  -				 :password password))
  +                 :login    login
  +                 :password password))
   
   (defvar *ssh-channel-buffer-size* 1400)
   
   (defclass ssh-channel-stream
  -	(trivial-gray-stream-mixin)
  +    (trivial-gray-stream-mixin)
     ((socket        :initarg  :socket
  -				  :accessor socket)
  +                  :accessor socket)
      (channel       :type     +CHANNEL+
  -				  :initarg  :channel
  -				  :accessor channel)))
  +                  :initarg  :channel
  +                  :accessor channel)))
   
   (defclass ssh-channel-stream-output
  -	(ssh-channel-stream)
  +    (ssh-channel-stream)
     ((output-buffer :initform (make-shareable-byte-vector
  -							 *ssh-channel-buffer-size*)
  -				  :accessor output-buffer)
  +                             *ssh-channel-buffer-size*)
  +                  :accessor output-buffer)
      (output-size   :initform 0
  -				  :accessor output-size
  -				  :type     int)
  +                  :accessor output-size
  +                  :type     int)
      (output-pos    :type     int
  -				  :initform 0
  -				  :accessor output-pos)))
  +                  :initform 0
  +                  :accessor output-pos)))
   
   (defclass ssh-channel-stream-input
  -	(ssh-channel-stream)
  +    (ssh-channel-stream)
     ((input-buffer  :initform (make-shareable-byte-vector
  -							 *ssh-channel-buffer-size*)
  -				  :accessor input-buffer)
  +                             *ssh-channel-buffer-size*)
  +                  :accessor input-buffer)
      (input-size    :initform 0
  -				  :accessor input-size
  -				  :type     int)
  +                  :accessor input-size
  +                  :type     int)
      (input-pos     :type     int
  -				  :initform 0
  -				  :accessor input-pos)))
  +                  :initform 0
  +                  :accessor input-pos)))
   
   (defclass ssh-channel-stream-input/output
  -	(ssh-channel-stream-input
  -	 ssh-channel-stream-output)
  +  (ssh-channel-stream-input
  +   ssh-channel-stream-output)
     ())
   
   (defclass ssh-channel-exec
  -	(ssh-channel-stream-input/output
  -	 fundamental-binary-output-stream
  -	 fundamental-character-output-stream
  -	 fundamental-binary-input-stream
  -	 fundamental-character-input-stream)
  +  (ssh-channel-stream-input/output
  +   fundamental-binary-output-stream
  +   fundamental-character-output-stream
  +   fundamental-binary-input-stream
  +   fundamental-character-input-stream)
     ())
   
   (defclass ssh-channel-recv
  -	(ssh-channel-stream-input
  -	 fundamental-binary-input-stream)
  +  (ssh-channel-stream-input
  +   fundamental-binary-input-stream)
     ())
   
   (defclass ssh-channel-send
  -	(ssh-channel-stream-output
  -	 fundamental-binary-output-stream)
  +  (ssh-channel-stream-output
  +   fundamental-binary-output-stream)
     ())
   
   (defmethod stream-element-type ((stream ssh-channel-stream))
  
positive.code:   ;; Then directly write this one
    (stream-finish-output* stream :dont-send-eof t)
    (channel-write-string (channel stream)
  						sharable-sequence
  						:start start
  						:end   end))
  
  (defmethod stream-write-sequence ((stream ssh-channel-stream-output) sequence start end &key)
    (with-slots (output-pos output-size output-buffer) stream
  	(let ((max-output-buffer     (length output-buffer))
  		  (requested-output-size (- end start)))
  	  (labels
  		  ((push-to-stream ()
  			 (let ((pushable-chunk-size (min requested-output-size
  											 max-output-buffer)))
  			   (if (>= (+ output-size pushable-chunk-size)
  					   max-output-buffer)
  				   (stream-finish-output* stream :dont-send-eof t))
  
  			   (when (<= (+ output-size pushable-chunk-size)
  						max-output-buffer)
  				 (progn
  				   (replace output-buffer sequence
  							:start1 output-size
  							:end1   (+ output-size
  									   pushable-chunk-size)
  							:start2 start
  							:end2   (+ start
  									   pushable-chunk-size))
  				   (incf output-size pushable-chunk-size)
  				   (decf requested-output-size pushable-chunk-size)
  				   (incf start pushable-chunk-size)
  				   (when (> requested-output-size 0)
  					 (push-to-stream)))))))
  		(push-to-stream)
  		sequence))))
  
  (defmethod close ((stream ssh-channel-stream) &key abort)
    (let ((channel (channel stream)))
  	(when (not (null-pointer-p channel))
  	  (unless abort
  		(stream-force-output stream)
  		(channel-flush channel))
  
  	  (channel-close channel)
  	  (channel-free channel))))
  
  (defmethod execute ((ssh ssh-connection) (command string))
    (with-slots (socket session) ssh
  	(let ((new-channel
  		   (channel-open session)))
  	  (if (pointerp new-channel)
  		  (if (not (null-pointer-p new-channel))
  			  (let ((retval (channel-exec new-channel command)))
  				(if (eq retval :ERROR-NONE)
  					(make-instance 'ssh-channel-exec
  								   :socket  socket
  								   :channel new-channel)
  					(throw-last-error session)))
  			  (throw-last-error session))
  		  (throw-last-error session)))))
  
  (defmethod scp-input ((ssh ssh-connection) (path string))
    (multiple-value-bind (new-channel stat)
  	  (channel-scp-recv (session ssh) path)
  	(unless (null-pointer-p new-channel)
  	  (values
  	   (make-instance 'ssh-channel-recv
  					  :socket  (socket ssh)
  					  :channel new-channel)
  	   stat))))
  
  (defmethod scp-output ((ssh ssh-connection) (path string) size
  					   &key mode mtime atime)
    (let ((new-channel
  		 (channel-scp-send (session ssh) path size
  						   :mode  mode
  						   :mtime mtime
  						   :atime atime)))
  	(unless (null-pointer-p new-channel)
  	  (make-instance 'ssh-channel-send
  					 :socket  (socket ssh)
  					 :channel new-channel))))
  
  (defmacro with-execute (command (ssh-connection stdio-stream)
  						&body body)
    `(let ((,stdio-stream (execute ,ssh-connection ,command)))
  	 (unwind-protect
  		  (let ((body-retval
  				 (progn ,@body)))
  			(values-list
  			 (list body-retval
  				   (channel-exit-status (channel ,stdio-stream)))))
  	   (close ,stdio-stream))))
  
  (defmacro with-execute* (command (ssh-connection stdio-stream)
  						 &body body)
    `(with-execute ,(concatenate 'string
  							   command " 2>&1")
  	   (,ssh-connection ,stdio-stream)
  	 (progn (stream-finish-output ,stdio-stream)
  			,@body)))
  
  (defmacro with-scp-input (path (ssh-connection istream object-stat)
  						  &body body)
    `(multiple-value-bind (,istream ,object-stat)
  	   (scp-input ,ssh-connection ,path)
  	 (declare (ignore ,object-stat))
  	 (unwind-protect
  		  (progn
  			,@body)
  	   (close ,istream))))
  
  (defmacro with-scp-output (path size (ssh-connection ostream &key
  									  mtime atime mode) &body body)
    `(let ((,ostream (scp-output ,ssh-connection ,path ,size
  							   :mode ,mode :atime ,atime, :mtime ,mtime)))
  	 (unwind-protect
  		  (progn
  			,@body)
  	   (close ,ostream))))
  
negative.code: 
  (defmethod stream-write-byte ((stream ssh-channel-stream-output) byte)
    (with-slots (output-pos output-size output-buffer) stream
      (if (>= output-size (length output-buffer))
        (stream-finish-output* stream :dont-send-eof t))
      (when (< output-size (length output-buffer))
      (prog1
        (setf (aref output-buffer output-size) byte)
        (incf output-size 1)))))
  
  (defmethod stream-write-char ((stream ssh-channel-stream-output) char)
    (stream-write-byte stream (char-code char)))
  