summaryrefslogtreecommitdiff
path: root/ot_fullscrape.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_fullscrape.c')
-rw-r--r--ot_fullscrape.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ot_fullscrape.c b/ot_fullscrape.c
index dfad640..5f61afd 100644
--- a/ot_fullscrape.c
+++ b/ot_fullscrape.c
@@ -113,7 +113,7 @@ static int fullscrape_increase( int *iovec_entries, struct iovec **iovector,
113} 113}
114 114
115static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tasktype mode ) { 115static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tasktype mode ) {
116 int bucket; 116 int bucket,i;
117 char *r, *re; 117 char *r, *re;
118#ifdef WANT_COMPRESSION_GZIP 118#ifdef WANT_COMPRESSION_GZIP
119 char compress_buffer[OT_SCRAPE_MAXENTRYLEN]; 119 char compress_buffer[OT_SCRAPE_MAXENTRYLEN];
@@ -163,7 +163,7 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
163 163
164 /* push hash as bencoded string */ 164 /* push hash as bencoded string */
165 *r++='2'; *r++='0'; *r++=':'; 165 *r++='2'; *r++='0'; *r++=':';
166 memmove( r, hash, 20 ); r+=20; 166 for(i=0;i<20;i+=4) WRITE32(r+=4,0,READ32(hash,i));
167 167
168 /* push rest of the scrape string */ 168 /* push rest of the scrape string */
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 ); 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 );
@@ -174,7 +174,7 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
174 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 );
175 break; 175 break;
176 case TASK_FULLSCRAPE_TPB_BINARY: 176 case TASK_FULLSCRAPE_TPB_BINARY:
177 memmove( r, hash, 20 ); r+=20; 177 for(i=0;i<20;i+=4) WRITE32(r+=4,0,READ32(hash,i));
178 *(uint32_t*)r++ = htonl( (uint32_t)peer_list->seed_count ); 178 *(uint32_t*)r++ = htonl( (uint32_t)peer_list->seed_count );
179 *(uint32_t*)r++ = htonl( (uint32_t)( peer_list->peer_count-peer_list->seed_count) ); 179 *(uint32_t*)r++ = htonl( (uint32_t)( peer_list->peer_count-peer_list->seed_count) );
180 break; 180 break;