Commit 1b7f41ca by Iwasaki Yudai Committed by GitHub

Merge pull request #156 from yudai/max_conn

Fix max connection enforcement
2 parents f23f38a4 dbcdc904
Showing with 1 additions and 1 deletions
......@@ -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
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!