Commit 842122be authored by David Byers's avatar David Byers
Browse files

Fixed bug 1321 for real

parent 0ce6d39b
2007-07-07 David Byers <davby@sysinst-gw.sysinst.ida.liu.se>
* vars.el.in (kom-ssh-general-errors): New variable.
(kom-ssh-forwarding-errors): New variable.
2007-07-07 <David Byers@GULAG>
* startup.el (lyskom-setup-ssh-relay): Detect failure to set up
......
......@@ -422,6 +422,7 @@ clients of the event. See lyskom-mode for details on lyskom."
kom-ssh-relay-host))
(when proc (delete-process proc))
(setq relay-port (+ 10000 (random 20000)))
(setq relay-port 4455)
(put procsym 'relay-host
(if (string-match "@" kom-ssh-relay-host)
(substring kom-ssh-relay-host (1+ (match-beginning 0)))
......@@ -451,7 +452,8 @@ clients of the event. See lyskom-mode for details on lyskom."
(goto-char (point-max))
(re-search-backward "^--- .* ---$" nil t)
(not (re-search-forward "^ok$" nil t)))
(when (re-search-forward "\\<\\(Enter passphrase.*$\\|^.*password.*$\\)\\|refused\\|disconnect\\|denied\\|error\\|key not found\\|cannot listen\\|[Aa]ddress already in use\\>" nil t)
(when (or (re-search-forward kom-ssh-general-errors nil t)
(not (eq 'run (process-status proc))))
(cond ((match-string 1)
(process-send-string
proc
......@@ -464,6 +466,20 @@ clients of the event. See lyskom-mode for details on lyskom."
(progn (skip-chars-forward "^\n\r")
(point)))))))
(sleep-for 0.5))
;; Check that local forwarding works.
(save-excursion
(goto-char (point-max))
(re-search-backward "^--- .* ---$" nil t)
(when (re-search-forward kom-ssh-forwarding-errors nil t)
(kill-process proc)
(error (lyskom-get-string 'ssh-cant-connect)
(buffer-substring-no-properties
(progn (beginning-of-line) (point))
(progn (skip-chars-forward "^\n\r")
(point))))))
(setq proc nil)
(lyskom-message
"%s"
......
......@@ -2861,6 +2861,15 @@ Non-string values are reserved for future use.")
local
protected)
(def-kom-var kom-ssh-general-errors
"\\<\\(Enter passphrase.*$\\|^.*password.*$\\)\\|refused\\|disconnect\\|denied\\|error\\|key not found\\|cannot listen\\|[Aa]ddress already in use\\>"
"**Regexp for messages from ssh that indicate that ssh has failed.")
(def-kom-var kom-ssh-forwarding-errors
"\\<cannot listen\\|[Aa]ddress already in use\\>"
"**Regexp for messages from ssh that indicate that forwarding failed.")
(def-kom-var kom-www-proxy nil
"**Controls use of an HTTP proxy for the LysKOM session.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment