mirror of
https://github.com/transmission/transmission
synced 2025-02-15 19:04:45 +00:00
when creating a new torrent and a tracker announce URL can't be parsed, set a variable so that the client can learn which announce URL was the bad one
This commit is contained in:
parent
fd934eeaff
commit
9b9c910d67
2 changed files with 10 additions and 3 deletions
|
@ -379,9 +379,13 @@ tr_realMakeMetaInfo( tr_metainfo_builder * builder )
|
|||
tr_benc top;
|
||||
|
||||
/* allow an empty set, but if URLs *are* listed, verify them. #814, #971 */
|
||||
for( i = 0; i < builder->trackerCount && !builder->result; ++i )
|
||||
if( !tr_httpIsValidURL( builder->trackers[i].announce ) )
|
||||
for( i = 0; i < builder->trackerCount && !builder->result; ++i ) {
|
||||
if( !tr_httpIsValidURL( builder->trackers[i].announce ) ) {
|
||||
tr_strlcpy( builder->errfile, builder->trackers[i].announce,
|
||||
sizeof( builder->errfile ) );
|
||||
builder->result = TR_MAKEMETA_URL;
|
||||
}
|
||||
}
|
||||
|
||||
tr_bencInitDict( &top, 6 );
|
||||
|
||||
|
@ -506,7 +510,9 @@ tr_makeMetaInfo( tr_metainfo_builder * builder,
|
|||
|
||||
/* initialize the builder variables */
|
||||
builder->abortFlag = 0;
|
||||
builder->result = 0;
|
||||
builder->isDone = 0;
|
||||
builder->pieceIndex = 0;
|
||||
builder->trackerCount = trackerCount;
|
||||
builder->trackers = tr_new0( tr_tracker_info, builder->trackerCount );
|
||||
for( i = 0; i < builder->trackerCount; ++i )
|
||||
|
|
|
@ -74,7 +74,8 @@ typedef struct tr_metainfo_builder
|
|||
int isDone;
|
||||
tr_metainfo_builder_err result;
|
||||
|
||||
/* file in use when result was set to _IO_READ or _IO_WRITE */
|
||||
/* file in use when result was set to _IO_READ or _IO_WRITE,
|
||||
* or the URL in use when the result was set to _URL */
|
||||
char errfile[2048];
|
||||
|
||||
/* errno encountered when result was set to _IO_READ or _IO_WRITE */
|
||||
|
|
Loading…
Reference in a new issue