(trunk) #3341 "support alternate tracker syntax in magnet links" -- fixed

This commit is contained in:
Charles Kerr 2010-06-24 18:25:21 +00:00
parent a54270a11a
commit 5a0d9351d2
1 changed files with 7 additions and 2 deletions

View File

@ -151,8 +151,13 @@ tr_magnetParse( const char * uri )
if( ( keylen==2 ) && !memcmp( key, "dn", 2 ) )
displayName = tr_http_unescape( val, vallen );
if( ( keylen==2 ) && !memcmp( key, "tr", 2 ) && ( trCount < MAX_TRACKERS ) )
tr[trCount++] = tr_http_unescape( val, vallen );
if( trCount < MAX_TRACKERS ) {
int i;
if( ( keylen==2 ) && !memcmp( key, "tr", 2 ) )
tr[trCount++] = tr_http_unescape( val, vallen );
else if( ( sscanf( key, "tr.%d=", &i ) == 1 ) && ( i > 0 ) ) /* ticket #3341 */
tr[trCount++] = tr_http_unescape( val, vallen );
}
if( ( keylen==2 ) && !memcmp( key, "ws", 2 ) && ( wsCount < MAX_TRACKERS ) )
ws[wsCount++] = tr_http_unescape( val, vallen );