mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-12-22 23:17:29 +00:00
Merge pull request #156 from yudai/max_conn
Fix max connection enforcement
This commit is contained in:
commit
1b7f41ca6f
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user