Skip to content

Commit

Permalink
Fix the indium server filter process
Browse files Browse the repository at this point in the history
* indium-client.el (indium-client--process-filter-function): Do not try to
  connect once a connection has been made.
  • Loading branch information
NicolasPetton committed Aug 14, 2018
1 parent c42da45 commit b2866e9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions indium-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,15 @@ Evaluate CALLBACK when the server starts listening to TCP connections."
(let ((connected nil))
(lambda (process output)
(unless connected ;; do not try to open TCP connections multiple times
(with-current-buffer (process-buffer process)
(goto-char (point-max))
(insert output))
(if (string-match-p "server listening" output)
(indium-client--open-network-stream callback)
(progn
(indium-client-stop)
(error "Indium server process error: %s" output)))))))
(setq connected t)
(with-current-buffer (process-buffer process)
(goto-char (point-max))
(insert output))
(if (string-match-p "server listening" output)
(indium-client--open-network-stream callback)
(progn
(indium-client-stop)
(error "Indium server process error: %s" output)))))))

(defun indium-client--open-network-stream (callback)
"Open a network connection to the indium server TCP process.
Expand Down

0 comments on commit b2866e9

Please sign in to comment.