Merge pull request #1190 from lucas-clemente/proxy-closing

properly close the UDP proxy used in the integration tests
This commit is contained in:
Marten Seemann
2018-02-22 19:59:13 +08:00
committed by GitHub
2 changed files with 44 additions and 0 deletions

View File

@@ -139,6 +139,13 @@ func NewQuicProxy(local string, version protocol.VersionNumber, opts *Opts) (*Qu
// Close stops the UDP Proxy
func (p *QuicProxy) Close() error {
p.mutex.Lock()
defer p.mutex.Unlock()
for _, c := range p.clientDict {
if err := c.ServerConn.Close(); err != nil {
return err
}
}
return p.conn.Close()
}