From a7227450cabf34417eaac5534e49c20536440f18 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 10 Jul 2001 11:26:54 +0000 Subject: [PATCH] Removed call/cc from handler of bind-listen-accept-loop: We want to close the socket, but not prevent the exception to come through (Otherwise you get 'interrupted on undefined globals...). --- scsh/network.scm | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/scsh/network.scm b/scsh/network.scm index e60a10f..78f48dd 100644 --- a/scsh/network.scm +++ b/scsh/network.scm @@ -86,24 +86,22 @@ (set-socket-option sock level/socket socket/reuse-address #t) (bind-socket sock addr) (listen-socket sock 5) - (call-with-current-continuation - (lambda (exit) + (with-handler + (lambda (condition more) (with-handler - (lambda (condition more) - (with-handler - (lambda (condition ignore) (more)) - (lambda () (close-socket sock))) - (exit 'interrupted)) - (lambda () - (let loop () - (with-errno-handler - ;; ECONNABORTED we just ignore - ((errno packet) - ((errno/connaborted) (loop))) - (call-with-values - (lambda () (accept-connection sock)) - proc) - (loop))))))))) + (lambda (condition ignore) (more)) + (lambda () (close-socket sock))) + (more)) + (lambda () + (let loop () + (with-errno-handler + ;; ECONNABORTED we just ignore + ((errno packet) + ((errno/connaborted) (loop))) + (call-with-values + (lambda () (accept-connection sock)) + proc) + (loop))))))) ;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ;;; Socket Record Structure