1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00

remove context in struct

This commit is contained in:
Darien Raymond
2018-02-08 15:39:46 +01:00
parent a1ae4aa515
commit efcb567273
44 changed files with 379 additions and 270 deletions

14
dns.go
View File

@@ -1,7 +1,11 @@
package core
import "net"
import "sync"
import (
"net"
"sync"
"v2ray.com/core/common"
)
// DNSClient is a V2Ray feature for querying DNS information.
type DNSClient interface {
@@ -36,13 +40,11 @@ func (d *syncDNSClient) Start() error {
return d.DNSClient.Start()
}
func (d *syncDNSClient) Close() {
func (d *syncDNSClient) Close() error {
d.RLock()
defer d.RUnlock()
if d.DNSClient != nil {
d.DNSClient.Close()
}
return common.Close(d.DNSClient)
}
func (d *syncDNSClient) Set(client DNSClient) {