wrong debug buffer.
(tramp-gw-open-connection): Set process coding system 'binary.
(tramp-gw-open-network-stream): Handle HTTP error 403.
* net/tramp-sh.el (tramp-compute-multi-hops): Suppress traces in
wrong debug buffer.
(tramp-maybe-open-connection): Set connection property "gateway".
* net/tramp.el (tramp-error-with-buffer): Call `message' properly.
(tramp-accept-process-output): Use nil as argument for
`accept-process-output', when there is a gateway prepended.
+2014-12-17 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-error-with-buffer): Call `message' properly.
+ (tramp-accept-process-output): Use nil as argument for
+ `accept-process-output', when there is a gateway prepended.
+
+ * net/tramp-gw.el (tramp-gw-open-connection): Suppress traces in
+ wrong debug buffer.
+ (tramp-gw-open-connection): Set process coding system 'binary.
+ (tramp-gw-open-network-stream): Handle HTTP error 403.
+
+ * net/tramp-sh.el (tramp-compute-multi-hops): Suppress traces in
+ wrong debug buffer.
+ (tramp-maybe-open-connection): Set connection property "gateway".
+
2014-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (sit-for): Tweak docstring (bug#19381).
(setq tramp-gw-gw-proc
(funcall
socks-function
- (tramp-get-connection-name gw-vec)
- (tramp-get-connection-buffer gw-vec)
+ (let ((tramp-verbose 0)) (tramp-get-connection-name gw-vec))
+ (let ((tramp-verbose 0)) (tramp-get-connection-buffer gw-vec))
(tramp-file-name-real-host target-vec)
(tramp-file-name-port target-vec)))
(set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
+ (set-process-coding-system tramp-gw-gw-proc 'binary 'binary)
(tramp-compat-set-process-query-on-exit-flag tramp-gw-gw-proc nil)
(tramp-message
vec 4 "Opened %s process `%s'"
(200 (setq found t))
;; We need basic authentication.
(401 (setq authentication (tramp-gw-basic-authentication nil first)))
+ ;; Access forbidden.
+ (403 (tramp-error-with-buffer
+ (current-buffer) tramp-gw-vector 'file-error
+ "Connection to %s:%d forbidden." host service))
;; Target host not found.
(404 (tramp-error-with-buffer
(current-buffer) tramp-gw-vector 'file-error
;; Therefore, we must remember the gateway vector. But we
;; cannot do it as connection property, because it shouldn't
;; be persistent. And we have no started process yet either.
- (tramp-set-file-property (car target-alist) "" "gateway" hop)))
+ (let ((tramp-verbose 0))
+ (tramp-set-file-property (car target-alist) "" "gateway" hop))))
;; Foreign and out-of-band methods are not supported for multi-hops.
(when (cdr target-alist)
l-method 'tramp-connection-timeout))
(gw-args
(tramp-get-method-parameter l-method 'tramp-gw-args))
- (gw (tramp-get-file-property hop "" "gateway" nil))
+ (gw (let ((tramp-verbose 0))
+ (tramp-get-file-property hop "" "gateway" nil)))
(g-method (and gw (tramp-file-name-method gw)))
(g-user (and gw (tramp-file-name-user gw)))
(g-host (and gw (tramp-file-name-real-host gw)))
(setq login-args (append async-args login-args)))
;; Add gateway arguments if necessary.
- (when (and gw gw-args)
- (setq login-args (append gw-args login-args)))
+ (when gw
+ (tramp-set-connection-property p "gateway" t)
+ (when gw-args
+ (setq login-args (append gw-args login-args))))
;; Check for port number. Until now, there's no
;; need for handling like method, user, host.
(let ((enable-recursive-minibuffers t))
;; `tramp-error' does not show messages. So we must do it
;; ourselves.
- (message fmt-string arguments)
+ (apply 'message fmt-string arguments)
;; Show buffer.
(pop-to-buffer buf)
(discard-input)
This is needed in order to hide `last-coding-system-used', which is set
for process communication also."
(with-current-buffer (process-buffer proc)
- (tramp-message proc 10 "%s %s" proc (process-status proc))
- (let (buffer-read-only last-coding-system-used)
+ ;; FIXME: If there is a gateway process, we need communication
+ ;; between several processes. Too complicate to implement, so we
+ ;; read output from all proceeses.
+ (let ((p (if (tramp-get-connection-property proc "gateway" nil) nil proc))
+ buffer-read-only last-coding-system-used)
;; Under Windows XP, accept-process-output doesn't return
;; sometimes. So we add an additional timeout.
(with-timeout ((or timeout 1))
(if (featurep 'xemacs)
- (accept-process-output proc timeout timeout-msecs)
- (accept-process-output proc timeout timeout-msecs (and proc t)))))
- (tramp-message proc 10 "\n%s" (buffer-string))))
+ (accept-process-output p timeout timeout-msecs)
+ (accept-process-output p timeout timeout-msecs (and proc t))))
+ (tramp-message proc 10 "%s %s %s\n%s"
+ proc (process-status proc) p (buffer-string)))))
(defun tramp-check-for-regexp (proc regexp)
"Check, whether REGEXP is contained in process buffer of PROC.