Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 176748 Details for
Bug 252992
net-p2p/transmission: new ebuild for 1.42 and small patch for transmissioncli
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch for transmissioncli
transmission_cli-1.42.patch (text/plain), 2.23 KB, created by
Andrej Gelenberg
on 2008-12-29 14:35:18 UTC
(
hide
)
Description:
patch for transmissioncli
Filename:
MIME Type:
Creator:
Andrej Gelenberg
Created:
2008-12-29 14:35:18 UTC
Size:
2.23 KB
patch
obsolete
>diff --git a/cli/cli.c b/cli/cli.c >index ea0b66b..9092477 100644 >--- a/cli/cli.c >+++ b/cli/cli.c >@@ -57,11 +57,16 @@ static sig_atomic_t manualUpdate = 0; > static const char * torrentPath = NULL; > static const char * downloadDir = NULL; > static const char * finishCall = NULL; >-static const char * announce = NULL; > static const char * configdir = NULL; > static const char * sourceFile = NULL; > static const char * comment = NULL; > >+struct announce_t { >+ int num; >+ tr_tracker_info *trackers; >+}; >+static struct announce_t announce = { 0, NULL }; >+ > static const struct tr_option options[] = > { > { 'a', "announce", "Set the new torrent's announce URL", >@@ -391,10 +396,7 @@ main( int argc, > { > int err; > tr_metainfo_builder * b = tr_metaInfoBuilderCreate( h, sourceFile ); >- tr_tracker_info ti; >- ti.tier = 0; >- ti.announce = (char*) announce; >- tr_makeMetaInfo( b, torrentPath, &ti, 1, comment, isPrivate ); >+ tr_makeMetaInfo( b, torrentPath, announce.trackers, announce.num, comment, isPrivate ); > while( !b->isDone ) > { > tr_wait( 1000 ); >@@ -555,6 +557,33 @@ numarg( const char * arg ) > return num; > } > >+static void add_announce(const char * tracker_url) >+{ >+ if ( tracker_url == NULL ) >+ return; >+ >+ // argc is an integer, also announce.num should not overflow >+ ++announce.num; >+ if ( (SIZE_MAX / sizeof(tr_tracker_info)) < (size_t)announce.num ) >+ { >+ puts("To many announces\n"); >+ exit(EXIT_FAILURE); >+ } >+ >+ tr_tracker_info *new_trackers = realloc(announce.trackers, sizeof(tr_tracker_info) * announce.num); >+ >+ if ( new_trackers == NULL ) >+ { >+ free(announce.trackers); >+ puts("Not enough ram\n"); >+ exit(EXIT_FAILURE); >+ } >+ announce.trackers = new_trackers; >+ >+ new_trackers[announce.num-1].tier = 0; >+ new_trackers[announce.num-1].announce = tracker_url; >+} >+ > static int > parseCommandLine( int argc, > const char ** argv ) >@@ -567,7 +596,7 @@ parseCommandLine( int argc, > switch( c ) > { > case 'a': >- announce = optarg; break; >+ add_announce(optarg); break; > > case 'b': > blocklistEnabled = 1; break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 252992
:
176746
| 176748 |
176755