File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ type localDoHHandler struct {
18
18
19
19
func (handler localDoHHandler ) ServeHTTP (writer http.ResponseWriter , request * http.Request ) {
20
20
proxy := handler .proxy
21
+ if ! proxy .clientsCountInc () {
22
+ dlog .Warnf ("Too many incoming connections (max=%d)" , proxy .maxClients )
23
+ return
24
+ }
25
+ defer proxy .clientsCountDec ()
21
26
dataType := "application/dns-message"
22
27
writer .Header ().Set ("Server" , "dnscrypt-proxy" )
23
28
if request .URL .Path != proxy .localDoHPath {
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ func (proxy *Proxy) udpListener(clientPc *net.UDPConn) {
264
264
go func () {
265
265
start := time .Now ()
266
266
if ! proxy .clientsCountInc () {
267
- dlog .Warnf ("Too many connections (max=%d)" , proxy .maxClients )
267
+ dlog .Warnf ("Too many incoming connections (max=%d)" , proxy .maxClients )
268
268
return
269
269
}
270
270
defer proxy .clientsCountDec ()
@@ -294,7 +294,7 @@ func (proxy *Proxy) tcpListener(acceptPc *net.TCPListener) {
294
294
start := time .Now ()
295
295
defer clientPc .Close ()
296
296
if ! proxy .clientsCountInc () {
297
- dlog .Warnf ("Too many connections (max=%d)" , proxy .maxClients )
297
+ dlog .Warnf ("Too many incoming connections (max=%d)" , proxy .maxClients )
298
298
return
299
299
}
300
300
defer proxy .clientsCountDec ()
You can’t perform that action at this time.
0 commit comments