From 78f86118d76084fc4b8b8df50ffcf4e21555caf1 Mon Sep 17 00:00:00 2001 From: James Reeves Date: Sat, 11 Feb 2012 00:20:36 +0000 Subject: [PATCH] Fixed infinite loop in try-port --- src/ring/server/standalone.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ring/server/standalone.clj b/src/ring/server/standalone.clj index 42c7d76..56ee52f 100644 --- a/src/ring/server/standalone.clj +++ b/src/ring/server/standalone.clj @@ -7,8 +7,10 @@ (if-not (sequential? port) (run-server port) (try (run-server (first port)) - (catch Exception _ - (try-port (next port) run-server))))) + (catch Exception ex + (if-let [port (next port)] + (try-port port run-server) + (throw ex)))))) (defn serve "Start a web server to run a handler."