Skip to content

Commit

Permalink
Fix max connection enforcement
Browse files Browse the repository at this point in the history
Closes #136.
  • Loading branch information
yudai committed Aug 8, 2017
1 parent 5f52fd3 commit 2733006
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2733006

Please sign in to comment.