anchor.diff:    ;; Then directly write this one
     (stream-finish-output* stream :dont-send-eof t)
     (channel-write-string (channel stream)
  -						sharable-sequence
  -						:start start
  -						:end   end))
  +            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))))
  +  (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))))
  +  (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)))))
  +  (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))))
  +    (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)
  +             &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))))
  +     (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)
  +            &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))))
  +   (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)
  +             &body body)
     `(with-execute ,(concatenate 'string
  -							   command " 2>&1")
  -	   (,ssh-connection ,stdio-stream)
  -	 (progn (stream-finish-output ,stdio-stream)
  -			,@body)))
  +                 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)
  +              &body body)
     `(multiple-value-bind (,istream ,object-stat)
  -	   (scp-input ,ssh-connection ,path)
  -	 (declare (ignore ,object-stat))
  -	 (unwind-protect
  -		  (progn
  -			,@body)
  -	   (close ,istream))))
  +     (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)
  +                    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))))
  +                 :mode ,mode :atime ,atime, :mtime ,mtime)))
  +   (unwind-protect
  +      (progn
  +      ,@body)
  +     (close ,ostream))))
  
positive.code:           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)))))))
  
  (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)))))
  
  (defmethod authentication ((ssh ssh-connection) (auth auth-password))
    (user-auth-password (session  ssh)
  					  (login    auth)
  					  (password auth)))
  
  (defclass auth-publickey (auth-data)
    ((public-key  :type     string
  				:initarg  :public-key
  				:initform "id_rsa.pub"
  				:accessor public-key)
     (private-key :type     string
  				:initarg  :private-key
  				:initform "id_rsa"
  				:accessor private-key)
     (password    :type     string
  				: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)))
  
  (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)))))
  
  (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)))
  
  (defun make-agent-auth (login)
    (make-instance 'auth-agent
  				 :login login))
  
  (defun make-password-auth (login password)
    (make-instance 'auth-password
  				 :login    login
  				 :password password))
  
  (defvar *ssh-channel-buffer-size* 1400)
  
  (defclass ssh-channel-stream
  	(trivial-gray-stream-mixin)
    ((socket        :initarg  :socket
  				  :accessor socket)
     (channel       :type     +CHANNEL+
  				  :initarg  :channel
  				  :accessor channel)))
  
  (defclass ssh-channel-stream-output
  	(ssh-channel-stream)
    ((output-buffer :initform (make-shareable-byte-vector
  							 *ssh-channel-buffer-size*)
  				  :accessor output-buffer)
     (output-size   :initform 0
  				  :accessor output-size
  				  :type     int)
     (output-pos    :type     int
  				  :initform 0
  				  :accessor output-pos)))
  
  (defclass ssh-channel-stream-input
  	(ssh-channel-stream)
    ((input-buffer  :initform (make-shareable-byte-vector
  							 *ssh-channel-buffer-size*)
  				  :accessor input-buffer)
     (input-size    :initform 0
  				  :accessor input-size
  				  :type     int)
     (input-pos     :type     int
  				  :initform 0
  				  :accessor input-pos)))
  
  (defclass ssh-channel-stream-input/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)
    ())
  
  (defclass ssh-channel-recv
  	(ssh-channel-stream-input
  	 fundamental-binary-input-stream)
    ())
  
  (defclass ssh-channel-send
  	(ssh-channel-stream-output
  	 fundamental-binary-output-stream)
    ())
  
  (defmethod stream-element-type ((stream ssh-channel-stream))
  
negative.code: 
  (defun  throw-last-error (session)
    (multiple-value-bind (message code)
        (session-last-error session)
      (error 'ssh-generic-error
             :message message
             :code    code)))
  
  (defmacro with-last-error ((session error-type) &rest args)
    `(multiple-value-bind (message code)
         (session-last-error ,session)
       (error (quote ,error-type)
              :message message
              :code    code
              ,@args)))
  
  (defclass auth-data ()
    ((login    :type      string
               :initarg   :login
               :initform  ""
               :reader    login)))
  
  (defclass ssh-connection ()
    ((session     :type     +session+
                  :initarg  :session
                  :initform (null-pointer)
                  :reader   session)
     (socket      :type     usocket:socket
                  :initarg  :socket
                  :accessor socket)
     (host        :type     string
                  :initarg  :host
                  :accessor host)
     (port        :type     int
                  :initarg  :port
                  :accessor port)
     (hosts-db    :type     string
                  :initarg  :hosts-db
                  :accessor hosts-db)
     (auth-passed :type     boolean
                  :initform nil
                  :accessor auth-passed)))
  
  (define-condition ssh-handshake-error (ssh-generic-error) ())
  
  (define-condition ssh-bad-hostkey (error)
    ((reason :type      +check-verdict+
             :accessor  reason
             :initarg   :reason)
     (hash   :type      string
             :accessor  hash
             :initarg   :hash)))
  
  (defmethod create-ssh-connection (host (hosts-db string)
                    &key
                    (port 22)
                    (read-timeout 5)
                    (write-timeout 5))
    (let ((new-session nil)
      (new-socket  nil)
      (retval      :error-none))
    (unwind-protect
       (progn
         (setq new-session (session-init))
         (setq new-socket (usocket:socket-connect host port))
         (set-timeouts new-socket read-timeout write-timeout)
         (session-set-blocking new-session :blocking)
  
         (setq retval
           (session-handshake new-session (usocket-get-fd new-socket)))
  
         (if (eq retval :error-none)
           (make-instance 'ssh-connection
                  :session  new-session
                  :socket   new-socket
                  :host     host
                  :port     port
                  :hosts-db hosts-db)
           (throw-last-error new-session)))
      (unless (eq retval :error-none)
      (unless (null-pointer-p new-session)
        (session-free new-session))
      (unless (null new-socket)
        (usocket:socket-close new-socket))
      nil))))
  
  
  (defmethod destroy-ssh-connection ((ssh ssh-connection) &key (description "") (lang ""))
  