diff options
| author | F. Jason Park | 2024-12-23 22:21:34 -0800 |
|---|---|---|
| committer | F. Jason Park | 2024-12-27 15:14:21 -0800 |
| commit | f5ebe47ba7723919f09adf8f28d896cfa8757842 (patch) | |
| tree | e360d5c0a01bbdf48283904182fc02d5fdace9b0 /test | |
| parent | a99e1cc745047977b0b7cbd25fe9df66e9c86a39 (diff) | |
| download | emacs-f5ebe47ba7723919f09adf8f28d896cfa8757842.tar.gz emacs-f5ebe47ba7723919f09adf8f28d896cfa8757842.zip | |
Reuse process in erc-server-delayed-check-reconnect
* doc/misc/erc.texi (Integrations): Set `erc-server-reconnect-function'
to `erc-server-delayed-check-reconnect' in SOCKS example, and add
definition for `erc-open-socks-tls-stream'. Mention possible
inaccuracies related to error detection with certain reconnect
strategies.
* lisp/erc/erc-backend.el (erc-server--reconnect-opened): New function.
(erc-server-delayed-check-reconnect): Attempt to reuse process if server
sends a complete PONG, and attempt to accommodate connectors that set
:nowait to nil.
(erc--server-delayed-check-connectors): Remove variable.
(erc-server-prefer-check-reconnect): Inline what was the internal
variable `erc--server-delayed-check-connectors' because it's no longer
used in unit tests. Add `erc-open-socks-tls-stream' to the set of
connector functions thought to be compatible with the "check" reconnect
strategy.
* test/lisp/erc/erc-scenarios-base-auto-recon.el
(erc-scenarios-base-auto-recon-no-proto): Adapt to expect "reuse" behavior.
* test/lisp/erc/resources/base/reconnect/ping-pong.eld: Delete unused file.
* test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld:
Capture PING cookie to send back to client.
* test/lisp/erc/resources/erc-d/resources/proxy-solo.eld: Delete unused
file. (Bug#62044)
Diffstat (limited to 'test')
4 files changed, 4 insertions, 17 deletions
diff --git a/test/lisp/erc/erc-scenarios-base-auto-recon.el b/test/lisp/erc/erc-scenarios-base-auto-recon.el index d6a114147b3..adde30e6d47 100644 --- a/test/lisp/erc/erc-scenarios-base-auto-recon.el +++ b/test/lisp/erc/erc-scenarios-base-auto-recon.el | |||
| @@ -100,6 +100,8 @@ | |||
| 100 | ((erc-server-flood-penalty 0.1) | 100 | ((erc-server-flood-penalty 0.1) |
| 101 | (erc-scenarios-common-dialog "base/reconnect") | 101 | (erc-scenarios-common-dialog "base/reconnect") |
| 102 | (erc-d-auto-pong nil) | 102 | (erc-d-auto-pong nil) |
| 103 | (erc-d-tmpl-vars | ||
| 104 | `((cookie . ,(lambda (a) (funcall a :set (funcall a :match 1)))))) | ||
| 103 | (dumb-server (erc-d-run "localhost" t 'unexpected-disconnect)) | 105 | (dumb-server (erc-d-run "localhost" t 'unexpected-disconnect)) |
| 104 | (port (process-contact dumb-server :service)) | 106 | (port (process-contact dumb-server :service)) |
| 105 | (erc--server-reconnect-timeout-scale-function (lambda (_) 1)) | 107 | (erc--server-reconnect-timeout-scale-function (lambda (_) 1)) |
| @@ -128,7 +130,6 @@ | |||
| 128 | (ert-info ("Service restored") | 130 | (ert-info ("Service restored") |
| 129 | (setq dumb-server (erc-d-run "localhost" port | 131 | (setq dumb-server (erc-d-run "localhost" port |
| 130 | 'just-ping | 132 | 'just-ping |
| 131 | 'ping-pong | ||
| 132 | 'unexpected-disconnect)) | 133 | 'unexpected-disconnect)) |
| 133 | (with-current-buffer "FooNet" | 134 | (with-current-buffer "FooNet" |
| 134 | (funcall expect 30 "server is in debug mode"))) | 135 | (funcall expect 30 "server is in debug mode"))) |
diff --git a/test/lisp/erc/resources/base/reconnect/ping-pong.eld b/test/lisp/erc/resources/base/reconnect/ping-pong.eld deleted file mode 100644 index b3d36cf6cec..00000000000 --- a/test/lisp/erc/resources/base/reconnect/ping-pong.eld +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | ;; -*- mode: lisp-data; -*- | ||
| 2 | ((ping 10 "PING ") | ||
| 3 | (0 "PONG fake")) | ||
| 4 | |||
| 5 | ((eof 10 EOF)) | ||
| 6 | ((drop 0 DROP)) | ||
diff --git a/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld b/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld index 80903f94155..281239dfdaa 100644 --- a/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld +++ b/test/lisp/erc/resources/base/reconnect/unexpected-disconnect.eld | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | ;; -*- mode: lisp-data; -*- | 1 | ;; -*- mode: lisp-data; -*- |
| 2 | 2 | ||
| 3 | ((~eof 60 EOF)) | 3 | ((~eof 60 EOF)) |
| 4 | ((~ping 60 "PING")) | 4 | ((~ping 60 "PING " (group (+ (in "0-9")))) |
| 5 | (0 "PONG " cookie)) | ||
| 5 | 6 | ||
| 6 | ((nick 10 "NICK tester")) | 7 | ((nick 10 "NICK tester")) |
| 7 | ((user 10 "USER user 0 * :tester") | 8 | ((user 10 "USER user 0 * :tester") |
diff --git a/test/lisp/erc/resources/erc-d/resources/proxy-solo.eld b/test/lisp/erc/resources/erc-d/resources/proxy-solo.eld deleted file mode 100644 index af216c80edc..00000000000 --- a/test/lisp/erc/resources/erc-d/resources/proxy-solo.eld +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | ;;; -*- mode: lisp-data -*- | ||
| 2 | |||
| 3 | ((pass 10.0 "PASS " (? ?:) "changeme")) | ||
| 4 | ((nick 0.2 "NICK tester")) | ||
| 5 | |||
| 6 | ((user 0.2 "USER user 0 * :" (group (+ alpha)) eos) | ||
| 7 | (0 ":*status!znc@znc.in NOTICE " nick " :You have no networks configured." | ||
| 8 | " Use /znc AddNetwork <network> to add one.") | ||
| 9 | (0 ":irc.znc.in 001 " nick " :Welcome " nick "!")) | ||