Browse Source

incorporate a more verbose ascii dump, provided by Tom <tom@foscore.com>

master
Dirk Engling 3 years ago
parent
commit
d1e6e4486c
3 changed files with 8 additions and 3 deletions
  1. +4
    -0
      ot_fullscrape.c
  2. +1
    -1
      ot_http.c
  3. +3
    -2
      ot_mutex.h

+ 4
- 0
ot_fullscrape.c View File

@@ -175,6 +175,10 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
to_hex( r, *hash ); r+= 2 * sizeof(ot_hash);
r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count );
break;
case TASK_FULLSCRAPE_TPB_ASCII_PLUS:
to_hex( r, *hash ); r+= 2 * sizeof(ot_hash);
r += sprintf( r, ":%zd:%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count, peer_list->down_count );
break;
case TASK_FULLSCRAPE_TPB_BINARY:
memcpy( r, *hash, sizeof(ot_hash) ); r += sizeof(ot_hash);
*(uint32_t*)(r+0) = htonl( (uint32_t) peer_list->seed_count );


+ 1
- 1
ot_http.c View File

@@ -184,7 +184,7 @@ static const ot_keywords keywords_mode[] =
{ NULL, -3 } };
static const ot_keywords keywords_format[] =
{ { "bin", TASK_FULLSCRAPE_TPB_BINARY }, { "ben", TASK_FULLSCRAPE }, { "url", TASK_FULLSCRAPE_TPB_URLENCODED },
{ "txt", TASK_FULLSCRAPE_TPB_ASCII }, { NULL, -3 } };
{ "txt", TASK_FULLSCRAPE_TPB_ASCII }, { "txtp", TASK_FULLSCRAPE_TPB_ASCII_PLUS }, { NULL, -3 } };

int mode = TASK_STATS_PEERS, scanon = 1, format = 0;



+ 3
- 2
ot_mutex.h View File

@@ -47,8 +47,9 @@ typedef enum {
TASK_FULLSCRAPE = 0x0200, /* Default mode */
TASK_FULLSCRAPE_TPB_BINARY = 0x0201,
TASK_FULLSCRAPE_TPB_ASCII = 0x0202,
TASK_FULLSCRAPE_TPB_URLENCODED = 0x0203,
TASK_FULLSCRAPE_TRACKERSTATE = 0x0204,
TASK_FULLSCRAPE_TPB_ASCII_PLUS = 0x0203,
TASK_FULLSCRAPE_TPB_URLENCODED = 0x0204,
TASK_FULLSCRAPE_TRACKERSTATE = 0x0205,

TASK_DMEM = 0x0300,



Loading…
Cancel
Save