diff options
author | erdgeist <> | 2009-03-12 18:47:02 +0000 |
---|---|---|
committer | erdgeist <> | 2009-03-12 18:47:02 +0000 |
commit | eec51a872c9b08bef1fcd006a8402dfcbf50889e (patch) | |
tree | 7971a119ed4a295c99006a2b4196024b308edff4 /ot_fullscrape.c | |
parent | 255ac58971d6ceef844b53ec32149b537285596a (diff) |
Re-implement logging busy networks to handle v6 API.
Implement a state dump for later reparsing.
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 |