Commit dbcdc904 by Iwasaki Yudai

Fix max connection enforcement

Closes #136.
1 parent b1e5d958
Showing with 1 additions and 1 deletions
...@@ -315,7 +315,7 @@ func (app *App) handleWS(w http.ResponseWriter, r *http.Request) { ...@@ -315,7 +315,7 @@ func (app *App) handleWS(w http.ResponseWriter, r *http.Request) {
connections := atomic.AddInt64(app.connections, 1) connections := atomic.AddInt64(app.connections, 1)
if int64(app.options.MaxConnection) != 0 { 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) log.Printf("Reached max connection: %d", app.options.MaxConnection)
return return
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!