diff options
Diffstat (limited to 'ot_fullscrape.c')
| -rw-r--r-- | ot_fullscrape.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ot_fullscrape.c b/ot_fullscrape.c index 4cd0a44..d284bd4 100644 --- a/ot_fullscrape.c +++ b/ot_fullscrape.c | |||
| @@ -162,14 +162,13 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas | |||
| 162 | switch( mode & TASK_TASK_MASK ) { | 162 | switch( mode & TASK_TASK_MASK ) { |
| 163 | case TASK_FULLSCRAPE: | 163 | case TASK_FULLSCRAPE: |
| 164 | default: | 164 | default: |
| 165 | |||
| 166 | /* push hash as bencoded string */ | 165 | /* push hash as bencoded string */ |
| 167 | *r++='2'; *r++='0'; *r++=':'; | 166 | *r++='2'; *r++='0'; *r++=':'; |
| 168 | memcpy( r, hash, sizeof(ot_hash) ); r += sizeof(ot_hash); | 167 | memcpy( r, hash, sizeof(ot_hash) ); r += sizeof(ot_hash); |
| 169 | /* push rest of the scrape string */ | 168 | /* push rest of the scrape string */ |
| 170 | r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zdee", peer_list->seed_count, peer_list->down_count, peer_list->peer_count-peer_list->seed_count ); | 169 | r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zdee", peer_list->seed_count, peer_list->down_count, peer_list->peer_count-peer_list->seed_count ); |
| 171 | 170 | ||
| 172 | break; | 171 | break; |
| 173 | case TASK_FULLSCRAPE_TPB_ASCII: | 172 | case TASK_FULLSCRAPE_TPB_ASCII: |
| 174 | to_hex( r, *hash ); r+= 2 * sizeof(ot_hash); | 173 | to_hex( r, *hash ); r+= 2 * sizeof(ot_hash); |
| 175 | r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count ); | 174 | r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count ); |
| @@ -184,6 +183,12 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas | |||
| 184 | r += fmt_urlencoded( r, (char *)*hash, 20 ); | 183 | r += fmt_urlencoded( r, (char *)*hash, 20 ); |
| 185 | r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count ); | 184 | r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count ); |
| 186 | break; | 185 | break; |
| 186 | case TASK_FULLSCRAPE_TRACKERSTATE: | ||
| 187 | memcpy( r, *hash, sizeof(ot_hash) ); r += sizeof(ot_hash); | ||
| 188 | uint64_pack_big( r, (uint64_t)peer_list->down_count ); | ||
| 189 | uint64_pack_big( r + 8, (uint64_t)peer_list->base ); | ||
| 190 | r += 16; | ||
| 191 | break; | ||
| 187 | } | 192 | } |
| 188 | 193 | ||
| 189 | #ifdef WANT_COMPRESSION_GZIP | 194 | #ifdef WANT_COMPRESSION_GZIP |
