mirror of
https://github.com/transmission/transmission
synced 2025-02-21 21:57:01 +00:00
(trunk libT) #2771 "Unable to add magnet URI from Mininova via web interface" -- fixed for 1.80
This commit is contained in:
parent
32be71309f
commit
7c29d46daa
1 changed files with 11 additions and 7 deletions
|
@ -1004,9 +1004,9 @@ isCurlURL( const char * filename )
|
|||
if( filename == NULL )
|
||||
return FALSE;
|
||||
|
||||
return ( strstr( filename, "ftp://" ) != NULL )
|
||||
|| ( strstr( filename, "http://" ) != NULL )
|
||||
|| ( strstr( filename, "https://" ) != NULL );
|
||||
return !memcmp( filename, "ftp://", 6 ) ||
|
||||
!memcmp( filename, "http://", 7 ) ||
|
||||
!memcmp( filename, "https://", 8 );
|
||||
}
|
||||
|
||||
static tr_file_index_t*
|
||||
|
@ -1104,23 +1104,27 @@ torrentAdd( tr_session * session,
|
|||
}
|
||||
else
|
||||
{
|
||||
if( filename == NULL )
|
||||
char * fname = tr_strstrip( tr_strdup( filename ) );
|
||||
|
||||
if( fname == NULL )
|
||||
{
|
||||
int len;
|
||||
char * metainfo = tr_base64_decode( metainfo_base64, -1, &len );
|
||||
tr_ctorSetMetainfo( ctor, (uint8_t*)metainfo, len );
|
||||
tr_free( metainfo );
|
||||
}
|
||||
else if( !strncmp( filename, "magnet:?", 8 ) )
|
||||
else if( !strncmp( fname, "magnet:?", 8 ) )
|
||||
{
|
||||
tr_ctorSetMagnet( ctor, filename );
|
||||
tr_ctorSetMagnet( ctor, fname );
|
||||
}
|
||||
else
|
||||
{
|
||||
tr_ctorSetMetainfoFromFile( ctor, filename );
|
||||
tr_ctorSetMetainfoFromFile( ctor, fname );
|
||||
}
|
||||
|
||||
addTorrentImpl( idle_data, ctor );
|
||||
|
||||
tr_free( fname );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue