]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-gw.el
-
[gnu-emacs] / lisp / net / tramp-gw.el
index e21aaf78914942033ee70eaf944d094391cf15d2..a1ddceb4682b7d2b8e4af884bd0a94323edb8c80 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tramp-gw.el --- Tramp utility functions for HTTP tunnels and SOCKS gateways
 
-;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
      tramp-gw-vector 4
      "Opening auxiliary process `%s', speaking with process `%s'"
      proc tramp-gw-gw-proc)
-    (tramp-compat-set-process-query-on-exit-flag proc nil)
+    (set-process-query-on-exit-flag proc nil)
     ;; We don't want debug messages, because the corresponding debug
     ;; buffer might be undecided.
     (let ((tramp-verbose 0))
 
 (defun tramp-gw-process-filter (proc string)
   (let ((tramp-verbose 0))
-    (process-send-string
-     (tramp-get-connection-property proc "process" nil) string)))
+    ;; The other process might have been stopped already.  We don't
+    ;; want to be interrupted then.
+    (ignore-errors
+      (process-send-string
+       (tramp-get-connection-property proc "process" nil) string))))
 
 ;;;###tramp-autoload
 (defun tramp-gw-open-connection (vec gw-vec target-vec)
@@ -155,7 +158,7 @@ instead of the host name declared in TARGET-VEC."
             :name (tramp-buffer-name aux-vec) :buffer nil :host 'local
             :server t :noquery t :service t :coding 'binary))
       (set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel)
-      (tramp-compat-set-process-query-on-exit-flag tramp-gw-aux-proc nil)
+      (set-process-query-on-exit-flag tramp-gw-aux-proc nil)
       (tramp-message
        vec 4 "Opening auxiliary process `%s', listening on port %d"
        tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service))))
@@ -201,7 +204,7 @@ instead of the host name declared in 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)
+    (set-process-query-on-exit-flag tramp-gw-gw-proc nil)
     (tramp-message
      vec 4 "Opened %s process `%s'"
      (case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS"))
@@ -232,14 +235,14 @@ authentication is requested from proxy server, provide it."
       (setq proc (open-network-stream
                  name buffer (nth 1 socks-server) (nth 2 socks-server)))
       (set-process-coding-system proc 'binary 'binary)
-      (tramp-compat-set-process-query-on-exit-flag proc nil)
+      (set-process-query-on-exit-flag proc nil)
       ;; Send CONNECT command.
       (process-send-string proc (format "%s%s\r\n" command authentication))
       (tramp-message
        tramp-gw-vector 6 "\n%s"
        (format
        "%s%s\r\n" command
-       (tramp-compat-replace-regexp-in-string ;; no password in trace!
+       (replace-regexp-in-string ;; no password in trace!
         "Basic [^\r\n]+" "Basic xxxxx" authentication t)))
       (with-current-buffer buffer
        ;; Trap errors to be traced in the right trace buffer.  Often,