Skip to content

Commit

Permalink
changed to anonymous field closes #2567
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed May 24, 2015
1 parent c78c68e commit e3362f3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/github.com/getlantern/fronted/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (d *dialer) HttpClientUsing(masquerade *Masquerade) *http.Client {
}

type DirectDomainTransport struct {
orig *http.Transport
http.Transport
}

func (ddf *DirectDomainTransport) RoundTrip(req *http.Request) (resp *http.Response, err error) {
Expand All @@ -212,7 +212,7 @@ func (ddf *DirectDomainTransport) RoundTrip(req *http.Request) (resp *http.Respo
if err != nil {
return nil, fmt.Errorf("Unable to construct request for url '%s' with error '%v'", normalized, err)
}
return ddf.orig.RoundTrip(norm)
return ddf.Transport.RoundTrip(norm)
}

func replacePrefix(s string, old string, new string) string {
Expand All @@ -223,19 +223,12 @@ func replacePrefix(s string, old string, new string) string {
}
}

func (ddf *DirectDomainTransport) CancelRequest(req *http.Request) {
ddf.orig.CancelRequest(req)
}

func (ddf *DirectDomainTransport) CloseIdleConnections() {
ddf.orig.CloseIdleConnections()
}

// Creates a new http.Client that does direct domain fronting.
func (d *dialer) NewDirectDomainFronter() *http.Client {
log.Debugf("Creating new direct domain fronter.")
return &http.Client{
Transport: &DirectDomainTransport{
orig: &http.Transport{
Transport: http.Transport{
Dial: func(network, addr string) (net.Conn, error) {
log.Debugf("Dialing server with direct domain fronter")
return d.dialServer()
Expand Down

0 comments on commit e3362f3

Please sign in to comment.