From 10e5e2cf91aa2f84b06a97bdd1da774136a81ec4 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 19 Jun 2021 15:15:18 +0200 Subject: [PATCH] Tighten --- syndicate-ssh/new-server.rkt | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/syndicate-ssh/new-server.rkt b/syndicate-ssh/new-server.rkt index e2ec9d5..29f707d 100644 --- a/syndicate-ssh/new-server.rkt +++ b/syndicate-ssh/new-server.rkt @@ -52,18 +52,15 @@ (at conn-ds (once [(message (ssh-identification-line $remote-identification)) - (if (not (regexp-match #rx"^SSH-2\\.0-.*" remote-identification)) - (begin - (log-error "Invalid peer identification string ~v" remote-identification) - (stop-actor-system)) - (begin - (send! (inbound-credit 1)) - (spawn #:name 'session - (ssh-session conn-ds - ground-ds - local-identification - remote-identification - 'server))))]) + (cond + [(regexp-match #rx"^SSH-2\\.0-.*" remote-identification) + (send! (inbound-credit 1)) + (spawn + #:name 'session + (ssh-session conn-ds ground-ds local-identification remote-identification 'server))] + [else + (log-error "Invalid peer identification string ~v" remote-identification) + (stop-actor-system)])]) (during (SshAuthenticatedUser $user-name #"ssh-connection") (run-repl-instance conn-ds user-name))