From 27330065f2c6a87e7c7e00d650846de5e418462d Mon Sep 17 00:00:00 2001 From: Iwasaki Yudai Date: Tue, 8 Aug 2017 16:44:26 +0900 Subject: [PATCH] Fix max connection enforcement Closes #136. --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 5618bd0..78a7772 100644 --- a/app/app.go +++ b/app/app.go @@ -315,7 +315,7 @@ func (app *App) handleWS(w http.ResponseWriter, r *http.Request) { connections := atomic.AddInt64(app.connections, 1) if int64(app.options.MaxConnection) != 0 { - if connections >= int64(app.options.MaxConnection) { + if connections > int64(app.options.MaxConnection) { log.Printf("Reached max connection: %d", app.options.MaxConnection) return }