tracker/http.go | 12 ++++++------ diff --git a/tracker/http.go b/tracker/http.go index 15916ee9a50b76821ebe3d152d41598a5ff5a01a..3a733462c3dec1312190d376a8a6ecbbb2a82129 100644 --- a/tracker/http.go +++ b/tracker/http.go @@ -18,12 +18,12 @@ func init() { RegisterClientScheme("http", NewClient) } -type client struct { +type httpClient struct { url url.URL } func NewClient(url *url.URL) Client { - return &client{ + return &httpClient{ url: *url, } } @@ -54,7 +54,7 @@ } return } -func (me *client) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error) { +func (me *httpClient) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error) { q := make(url.Values) q.Set("info_hash", string(ar.InfoHash[:])) q.Set("peer_id", string(ar.PeerId[:])) @@ -99,15 +99,15 @@ ret.Peers, err = trackerResponse.UnmarshalPeers() return } -func (me *client) Connect() error { +func (me *httpClient) Connect() error { // HTTP trackers do not require a connecting handshake. return nil } -func (me *client) String() string { +func (me *httpClient) String() string { return me.URL() } -func (me *client) URL() string { +func (me *httpClient) URL() string { return me.url.String() }