trunk: Ensure only a single "?" is used for appending arguments to the announce and scrape URL (fixes #411)

This commit is contained in:
Mitchell Livingston 2007-10-25 16:52:12 +00:00
parent 317705cffc
commit b48967245d
2 changed files with 15 additions and 7 deletions

10
NEWS
View File

@ -2,12 +2,14 @@ NEWS file for Transmission <http://transmission.m0k.org/>
0.91 (2007/xx/xx)
- libtransmission (all platforms):
+ Fix 0.90 socket connection leak.
+ Fix 0.90 OpenBSD build error.
+ Fix 0.90 socket connection leak
+ Fix 0.90 OpenBSD build error
+ Ensure only a single "?" is used for appending arguments to the announce and scrape URL
- OS X:
+ Add Dutch localization, Re-add Russian localization, fix Korean localization
+ Fix a crash caused by custom sound files
+ Add Dutch localization, re-add Russian localization, fix Korean localization
- gtk:
+ Fix 0.90 packaging errors.
+ Fix 0.90 packaging errors
0.90 (2007/10/23)
- Encryption support, with option to ignore unencrypted peers

View File

@ -579,7 +579,10 @@ onScrapeNow( void * vt )
struct evhttp_request *req;
struct evbuffer * buf = evbuffer_new( );
evbuffer_add_printf( buf, "%s?info_hash=%s", address->scrape, t->escaped );
evbuffer_add_printf( buf, "%s%sinfo_hash=%s",
address->scrape,
( strchr(address->scrape, '?') == NULL ? "?" : "&" ),
t->escaped );
uri = tr_strdup( (char*) EVBUFFER_DATA( buf ) );
evbuffer_free( buf );
@ -619,8 +622,10 @@ buildTrackerRequestURI( const tr_tracker * t,
struct evbuffer * buf = evbuffer_new( );
char * ret;
char * ann = getCurrentAddress(t)->announce;
evbuffer_add_printf( buf, "%s"
"?info_hash=%s"
"%sinfo_hash=%s"
"&peer_id=%s"
"&port=%d"
"&uploaded=%"PRIu64
@ -634,7 +639,8 @@ buildTrackerRequestURI( const tr_tracker * t,
"&requirecrypto=%d"
"%s%s"
"%s%s",
getCurrentAddress(t)->announce,
ann,
( strchr(ann, '?') == NULL ? "?" : "&" ),
t->escaped,
t->peer_id,
tr_sharedGetPublicPort( t->handle->shared ),