linting the code

This commit is contained in:
9seconds
2019-10-11 09:41:18 +03:00
parent 432e2970a0
commit 5009859a1e
50 changed files with 172 additions and 55 deletions
+6 -1
View File
@@ -34,6 +34,7 @@ func (p *Proxy) Serve(listener net.Listener) {
continue
}
}
go p.accept(conn)
}
}
@@ -61,10 +62,12 @@ func (p *Proxy) accept(conn net.Conn) {
clientConn := stream.NewClientConn(conn, connID)
clientConn = stream.NewCtx(ctx, cancel, clientConn)
clientConn = stream.NewTimeout(clientConn)
defer clientConn.Close()
clientProtocol := p.ClientProtocolMaker()
clientConn, err := clientProtocol.Handshake(clientConn)
if err != nil {
logger.Warnw("Cannot perform client handshake", "error", err)
return
@@ -83,8 +86,10 @@ func (p *Proxy) accept(conn net.Conn) {
ClientProtocol: clientProtocol,
}
err = nil
if len(config.C.AdTag) > 0 {
err = middleConnection(req)
middleConnection(req)
} else {
err = directConnection(req)
}