Skip to content

Commit

Permalink
relocate type
Browse files Browse the repository at this point in the history
(cherry picked from commit 01f88c7)
  • Loading branch information
AZ-X committed Apr 14, 2021
1 parent 8ab86d8 commit 00dc97c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions repique/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ func (c *HTTPSContext) WithContext(inner context.Context) context.Context {
return &ctx
}

type TLSConn interface {
net.Conn
Handshake() error
ConnectionState() tls.ConnectionState
}

type Endpoint struct {
*net.IPAddr
Port int
Expand Down
7 changes: 6 additions & 1 deletion repique/protocols/tls/xtransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ func (th *TransportHolding) BuildTransport(XTransport *XTransport, proxies *conc

const parallel_dial_total = 5

type _TLSConn interface {
net.Conn
Handshake() error
ConnectionState() tls.ConnectionState
}

// I don't foresee any benefit from dtls, so let's wait for DNS over QUIC
func (XTransport *XTransport) FetchDoT(name string, serverProto string, ctx context.Context, body *[]byte, Timeout time.Duration, cbs ...interface{}) ([]byte, error) {
Expand Down Expand Up @@ -320,7 +325,7 @@ Go:
if err = conn.SetDeadline(time.Now().Add(Timeout)); err != nil {
goto Error
}
tlsConn := conn.(common.TLSConn)
tlsConn := conn.(_TLSConn)
if err = tlsConn.Handshake(); err != nil {
goto Error
}
Expand Down

0 comments on commit 00dc97c

Please sign in to comment.