add
This commit is contained in:
parent
64f8ec24e6
commit
2a75a80a0e
@ -276,7 +276,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string) {
|
|||||||
|
|
||||||
tcpsrcaddr := conn.RemoteAddr().(*net.TCPAddr)
|
tcpsrcaddr := conn.RemoteAddr().(*net.TCPAddr)
|
||||||
|
|
||||||
if p.localIdToConnMapSize >= p.maxconn {
|
if p.maxconn > 0 && p.localIdToConnMapSize >= p.maxconn {
|
||||||
loggo.Info("too many connections %d, client accept new local tcp fail %s", p.localIdToConnMapSize, tcpsrcaddr.String())
|
loggo.Info("too many connections %d, client accept new local tcp fail %s", p.localIdToConnMapSize, tcpsrcaddr.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -492,7 +492,7 @@ func (p *Client) Accept() error {
|
|||||||
now := time.Now()
|
now := time.Now()
|
||||||
clientConn := p.getClientConnByAddr(srcaddr.String())
|
clientConn := p.getClientConnByAddr(srcaddr.String())
|
||||||
if clientConn == nil {
|
if clientConn == nil {
|
||||||
if p.localIdToConnMapSize >= p.maxconn {
|
if p.maxconn > 0 && p.localIdToConnMapSize >= p.maxconn {
|
||||||
loggo.Info("too many connections %d, client accept new local udp fail %s", p.localIdToConnMapSize, srcaddr.String())
|
loggo.Info("too many connections %d, client accept new local udp fail %s", p.localIdToConnMapSize, srcaddr.String())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ func (p *Server) processPacket(packet *Packet) {
|
|||||||
localConn := p.getServerConnById(id)
|
localConn := p.getServerConnById(id)
|
||||||
if localConn == nil {
|
if localConn == nil {
|
||||||
|
|
||||||
if p.localConnMapSize >= p.maxconn {
|
if p.maxconn > 0 && p.localConnMapSize >= p.maxconn {
|
||||||
loggo.Info("too many connections %d, server connected target fail %s", p.localConnMapSize, packet.my.Target)
|
loggo.Info("too many connections %d, server connected target fail %s", p.localConnMapSize, packet.my.Target)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user