Merge pull request #64 from robaman/master

Retain query parameters from announce URL.
This commit is contained in:
Matt Joiner 2016-02-15 07:22:36 +11:00
commit a17e31794c
1 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,9 @@ func (r *httpResponse) UnmarshalPeers() (ret []Peer, err error) {
}
func (me *httpClient) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error) {
q := make(url.Values)
// retain query parameters from announce URL
q := me.url.Query()
q.Set("info_hash", string(ar.InfoHash[:]))
q.Set("peer_id", string(ar.PeerId[:]))
q.Set("port", fmt.Sprintf("%d", ar.Port))