mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +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 )
|
if( filename == NULL )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return ( strstr( filename, "ftp://" ) != NULL )
|
return !memcmp( filename, "ftp://", 6 ) ||
|
||||||
|| ( strstr( filename, "http://" ) != NULL )
|
!memcmp( filename, "http://", 7 ) ||
|
||||||
|| ( strstr( filename, "https://" ) != NULL );
|
!memcmp( filename, "https://", 8 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static tr_file_index_t*
|
static tr_file_index_t*
|
||||||
|
@ -1104,23 +1104,27 @@ torrentAdd( tr_session * session,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( filename == NULL )
|
char * fname = tr_strstrip( tr_strdup( filename ) );
|
||||||
|
|
||||||
|
if( fname == NULL )
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
char * metainfo = tr_base64_decode( metainfo_base64, -1, &len );
|
char * metainfo = tr_base64_decode( metainfo_base64, -1, &len );
|
||||||
tr_ctorSetMetainfo( ctor, (uint8_t*)metainfo, len );
|
tr_ctorSetMetainfo( ctor, (uint8_t*)metainfo, len );
|
||||||
tr_free( metainfo );
|
tr_free( metainfo );
|
||||||
}
|
}
|
||||||
else if( !strncmp( filename, "magnet:?", 8 ) )
|
else if( !strncmp( fname, "magnet:?", 8 ) )
|
||||||
{
|
{
|
||||||
tr_ctorSetMagnet( ctor, filename );
|
tr_ctorSetMagnet( ctor, fname );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tr_ctorSetMetainfoFromFile( ctor, filename );
|
tr_ctorSetMetainfoFromFile( ctor, fname );
|
||||||
}
|
}
|
||||||
|
|
||||||
addTorrentImpl( idle_data, ctor );
|
addTorrentImpl( idle_data, ctor );
|
||||||
|
|
||||||
|
tr_free( fname );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue