This commit is contained in:
Frank Denis 2018-03-17 14:47:17 -07:00
parent 1f81710b91
commit a0aeeabfa2
3 changed files with 9 additions and 13 deletions

View File

@ -75,8 +75,8 @@ func main() {
}
func (app *App) Start(service service.Service) error {
proxy := app.proxy
if err := InitPluginsGlobals(&proxy.pluginsGlobals, &proxy); err != nil {
proxy := &app.proxy
if err := InitPluginsGlobals(&proxy.pluginsGlobals, proxy); err != nil {
dlog.Fatal(err)
}
if proxy.daemonize {
@ -86,10 +86,10 @@ func (app *App) Start(service service.Service) error {
app.wg.Add(1)
if service != nil {
go func() {
app.AppMain(&proxy)
app.AppMain(proxy)
}()
} else {
app.AppMain(&proxy)
app.AppMain(proxy)
}
return nil
}

View File

@ -236,7 +236,7 @@ func (serversInfo *ServersInfo) fetchDNSCryptServerInfo(proxy *Proxy, name strin
if err != nil {
return ServerInfo{}, err
}
serverInfo := ServerInfo{
return ServerInfo{
Proto: StampProtoTypeDNSCrypt,
MagicQuery: certInfo.MagicQuery,
ServerPk: certInfo.ServerPk,
@ -247,8 +247,7 @@ func (serversInfo *ServersInfo) fetchDNSCryptServerInfo(proxy *Proxy, name strin
UDPAddr: remoteUDPAddr,
TCPAddr: remoteTCPAddr,
initialRtt: rtt,
}
return serverInfo, nil
}, nil
}
func (serversInfo *ServersInfo) fetchDoHServerInfo(proxy *Proxy, name string, stamp ServerStamp, isNew bool) (ServerInfo, error) {
@ -322,8 +321,7 @@ func (serversInfo *ServersInfo) fetchDoHServerInfo(proxy *Proxy, name string, st
} else {
dlog.Infof("[%s] OK (DoH) - rtt: %dms", name, rtt.Nanoseconds()/1000000)
}
serverInfo := ServerInfo{
return ServerInfo{
Proto: StampProtoTypeDoH,
Name: name,
Timeout: proxy.timeout,
@ -331,8 +329,7 @@ func (serversInfo *ServersInfo) fetchDoHServerInfo(proxy *Proxy, name string, st
HostName: stamp.providerName,
initialRtt: int(rtt.Nanoseconds() / 1000000),
useGet: useGet,
}
return serverInfo, nil
}, nil
}
func (serverInfo *ServerInfo) noticeFailure(proxy *Proxy) {

View File

@ -125,9 +125,8 @@ func (xTransport *XTransport) Fetch(method string, url *url.URL, accept string,
err = fmt.Errorf("Webserver returned code %d", resp.StatusCode)
}
return resp, rtt, err
} else {
(*xTransport.transport).CloseIdleConnections()
}
(*xTransport.transport).CloseIdleConnections()
dlog.Debugf("[%s]: [%s]", req.URL, err)
} else {
dlog.Debug("Ignoring system DNS")