(trunk libT) tweak the bencode comments a bit
This commit is contained in:
parent
fb587a5b30
commit
098658e3ad
|
@ -21,6 +21,8 @@ extern "C" {
|
||||||
|
|
||||||
struct evbuffer;
|
struct evbuffer;
|
||||||
|
|
||||||
|
/* these are PRIVATE IMPLEMENTATION details that should not be touched.
|
||||||
|
* it's included in the header for inlining and composition */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TR_TYPE_INT = 1,
|
TR_TYPE_INT = 1,
|
||||||
|
@ -31,9 +33,12 @@ enum
|
||||||
TR_TYPE_REAL = 32
|
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
|
typedef struct tr_benc
|
||||||
{
|
{
|
||||||
char type;
|
char type;
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
uint8_t b; /* bool type */
|
uint8_t b; /* bool type */
|
||||||
|
@ -44,15 +49,15 @@ typedef struct tr_benc
|
||||||
|
|
||||||
struct /* string type */
|
struct /* string type */
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i; /* the string length */
|
||||||
char * s;
|
char * s; /* the string */
|
||||||
} s;
|
} s;
|
||||||
|
|
||||||
struct /* list & dict types */
|
struct /* list & dict types */
|
||||||
{
|
{
|
||||||
size_t alloc;
|
size_t alloc; /* nodes allocated */
|
||||||
size_t count;
|
size_t count; /* nodes used */
|
||||||
struct tr_benc * vals;
|
struct tr_benc * vals; /* nodes */
|
||||||
} l;
|
} l;
|
||||||
} val;
|
} val;
|
||||||
} tr_benc;
|
} tr_benc;
|
||||||
|
@ -71,16 +76,9 @@ int tr_bencLoad( const void * buf,
|
||||||
tr_benc * setme_benc,
|
tr_benc * setme_benc,
|
||||||
char ** setme_end );
|
char ** setme_end );
|
||||||
|
|
||||||
int tr_bencLoadFile( const char * filename,
|
int tr_bencLoadFile( const char * filename, tr_benc * setme );
|
||||||
tr_benc * );
|
|
||||||
|
|
||||||
int tr_bencLoadJSONFile( const char * filename,
|
int tr_bencLoadJSONFile( const char * filename, tr_benc * setme );
|
||||||
tr_benc * );
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
void tr_bencPrint( const tr_benc * );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void tr_bencFree( tr_benc * );
|
void tr_bencFree( tr_benc * );
|
||||||
|
|
||||||
|
|
|
@ -499,7 +499,7 @@ onTrackerResponse( tr_session * session,
|
||||||
{
|
{
|
||||||
const int allAreSeeds = incomplete == 0;
|
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,
|
publishNewPeersCompact6( t, allAreSeeds, tmp->val.s.s,
|
||||||
tmp->val.s.i );
|
tmp->val.s.i );
|
||||||
|
|
Loading…
Reference in New Issue