(trunk libT) tweak the bencode comments a bit

This commit is contained in:
Charles Kerr 2009-04-21 16:52:28 +00:00
parent fb587a5b30
commit 098658e3ad
2 changed files with 22 additions and 24 deletions

View File

@ -21,6 +21,8 @@ extern "C" {
struct evbuffer;
/* these are PRIVATE IMPLEMENTATION details that should not be touched.
* it's included in the header for inlining and composition */
enum
{
TR_TYPE_INT = 1,
@ -31,9 +33,12 @@ enum
TR_TYPE_REAL = 32
};
/* these are PRIVATE IMPLEMENTATION details that should not be touched.
* it's included in the header for inlining and composition */
typedef struct tr_benc
{
char type;
union
{
uint8_t b; /* bool type */
@ -44,15 +49,15 @@ typedef struct tr_benc
struct /* string type */
{
size_t i;
char * s;
size_t i; /* the string length */
char * s; /* the string */
} s;
struct /* list & dict types */
{
size_t alloc;
size_t count;
struct tr_benc * vals;
size_t alloc; /* nodes allocated */
size_t count; /* nodes used */
struct tr_benc * vals; /* nodes */
} l;
} val;
} tr_benc;
@ -71,16 +76,9 @@ int tr_bencLoad( const void * buf,
tr_benc * setme_benc,
char ** setme_end );
int tr_bencLoadFile( const char * filename,
tr_benc * );
int tr_bencLoadFile( const char * filename, tr_benc * setme );
int tr_bencLoadJSONFile( const char * filename,
tr_benc * );
#if 0
void tr_bencPrint( const tr_benc * );
#endif
int tr_bencLoadJSONFile( const char * filename, tr_benc * setme );
void tr_bencFree( tr_benc * );

View File

@ -499,7 +499,7 @@ onTrackerResponse( tr_session * session,
{
const int allAreSeeds = incomplete == 0;
if( tmp->type == TR_TYPE_STR ) /* "compact" extension */
if( tr_bencIsString( tmp ) ) /* "compact" extension */
{
publishNewPeersCompact6( t, allAreSeeds, tmp->val.s.s,
tmp->val.s.i );