check accepting in http

pull/69/head
v2ray 2016-01-04 01:13:43 +01:00
parent e2623e65dd
commit 4a7f45113a
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,9 @@ func (this *HttpProxyServer) Listen(port v2net.Port) error {
func (this *HttpProxyServer) accept() {
for this.accepting {
retry.Timed(100 /* times */, 100 /* ms */).On(func() error {
if !this.accepting {
return nil
}
this.Lock()
defer this.Unlock()
if this.tcpListener != nil {