(trunk libT) use tr_torrentName() instead of tor->info.name

This commit is contained in:
Charles Kerr 2009-09-17 03:24:35 +00:00
parent 3ca7f7f63c
commit 034d14639a
5 changed files with 15 additions and 8 deletions

View File

@ -862,7 +862,7 @@ readCryptoProvide( tr_handshake * handshake,
const tr_bool clientIsSeed = tr_torrentIsSeed( tor );
const tr_bool peerIsSeed = tr_peerMgrPeerIsSeed( tor, tr_peerIoGetAddress( handshake->io, NULL ) );
dbgmsg( handshake, "got INCOMING connection's encrypted handshake for torrent [%s]",
tor->info.name );
tr_torrentName( tor ) );
tr_peerIoSetTorrentHash( handshake->io, tor->info.hash );
if( clientIsSeed && peerIsSeed )

View File

@ -171,7 +171,7 @@ struct tr_peerMgr
#define tordbg( t, ... ) \
do { \
if( tr_deepLoggingIsActive( ) ) \
tr_deepLog( __FILE__, __LINE__, t->tor->info.name, __VA_ARGS__ ); \
tr_deepLog( __FILE__, __LINE__, tr_torrentName( t->tor ), __VA_ARGS__ ); \
} while( 0 )
#define dbgmsg( ... ) \
@ -2363,7 +2363,7 @@ reconnectTorrent( Torrent * t )
"%d connection candidates, "
"%d atoms, "
"max per pulse is %d",
t->tor->info.name,
tr_torrentName( t->tor ),
mustCloseCount,
canCloseCount,
candidateCount,

View File

@ -219,7 +219,7 @@ myDebug( const char * file, int line,
evbuffer_add_printf( buf, "[%s] %s - %s [%s]: ",
tr_getLogTimeStr( timestr, sizeof( timestr ) ),
msgs->torrent->info.name,
tr_torrentName( msgs->torrent ),
tr_peerIoGetAddrStr( msgs->peer->io ),
msgs->peer->client );
va_start( args, fmt );

View File

@ -69,7 +69,7 @@ getResumeFilename( const tr_torrent * tor )
return tr_strdup_printf( "%s%c%s.%16.16s.resume",
tr_getResumeDir( tor->session ),
TR_PATH_DELIMITER,
tor->info.name,
tr_torrentName( tor ),
tor->info.hashString );
}
@ -501,7 +501,7 @@ tr_torrentSaveResume( const tr_torrent * tor )
if( !tr_isTorrent( tor ) )
return;
tr_tordbg( tor, "Saving .resume file for \"%s\"", tor->info.name );
tr_tordbg( tor, "Saving .resume file for \"%s\"", tr_torrentName( tor ) );
tr_bencInitDict( &top, 32 ); /* arbitrary "big enough" number */
tr_bencDictAddInt( &top, KEY_ACTIVITY_DATE,

View File

@ -326,7 +326,7 @@ enum
TORRENT_MAGIC_NUMBER = 95549
};
static inline tr_bool tr_isTorrent( const tr_torrent * tor )
static TR_INLINE tr_bool tr_isTorrent( const tr_torrent * tor )
{
return ( tor != NULL )
&& ( tor->magicNumber == TORRENT_MAGIC_NUMBER )
@ -335,11 +335,18 @@ static inline tr_bool tr_isTorrent( const tr_torrent * tor )
/* set a flag indicating that the torrent's .resume file
* needs to be saved when the torrent is closed */
static inline void tr_torrentSetDirty( tr_torrent * tor )
static TR_INLINE void tr_torrentSetDirty( tr_torrent * tor )
{
assert( tr_isTorrent( tor ) );
tor->isDirty = TRUE;
}
static TR_INLINE const char * tr_torrentName( const tr_torrent * tor )
{
assert( tr_isTorrent( tor ) );
return tor->info.name;
}
#endif