Skip to content
This repository has been archived by the owner on Nov 23, 2019. It is now read-only.

Commit

Permalink
Merge pull request #183 from WeiZhang555/hijack-throw-err
Browse files Browse the repository at this point in the history
Throw client.Do(req) error in postHijacked
  • Loading branch information
vdemeester committed Apr 1, 2016
2 parents b4eede2 + abe12a7 commit 8924d69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/hijack.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu
defer clientconn.Close()

// Server hijacks the connection, error 'connection closed' expected
clientconn.Do(req)
_, err = clientconn.Do(req)

rwc, br := clientconn.Hijack()

return types.HijackedResponse{Conn: rwc, Reader: br}, nil
return types.HijackedResponse{Conn: rwc, Reader: br}, err
}

func tlsDial(network, addr string, config *tls.Config) (net.Conn, error) {
Expand Down

0 comments on commit 8924d69

Please sign in to comment.