]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #3519 "webseeds don't work" -- patch from gostrc to add support for...
authorCharles Kerr <charles@transmissionbt.com>
Sun, 22 Aug 2010 18:40:18 +0000 (18:40 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sun, 22 Aug 2010 18:40:18 +0000 (18:40 +0000)
libtransmission/metainfo.c

index 7b33241c1ce99e93b6345e3cfdd5d602fe88649e..b77249e91e3f01240d1946bcc8cf4d5661da400d 100644 (file)
@@ -360,11 +360,11 @@ geturllist( tr_info * inf,
             tr_benc * meta )
 {
     tr_benc * urls;
+    const char * url;
 
     if( tr_bencDictFindList( meta, "url-list", &urls ) )
     {
         int          i;
-        const char * url;
         const int    n = tr_bencListSize( urls );
 
         inf->webseedCount = 0;
@@ -374,6 +374,12 @@ geturllist( tr_info * inf,
             if( tr_bencGetStr( tr_bencListChild( urls, i ), &url ) )
                 inf->webseeds[inf->webseedCount++] = tr_strdup( url );
     }
+    else if( tr_bencDictFindStr( meta, "url-list", &url ) ) /* handle single items in webseeds */
+    {
+        inf->webseedCount = 1;
+        inf->webseeds = tr_new0( char*, 1 );
+        inf->webseeds[0] = tr_strdup( url );
+    }
 }
 
 static int