summaryrefslogtreecommitdiff
path: root/ot_fullscrape.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_fullscrape.c')
-rw-r--r--ot_fullscrape.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ot_fullscrape.c b/ot_fullscrape.c
index 523d883..58546ca 100644
--- a/ot_fullscrape.c
+++ b/ot_fullscrape.c
@@ -165,8 +165,7 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
165 165
166 /* push hash as bencoded string */ 166 /* push hash as bencoded string */
167 *r++='2'; *r++='0'; *r++=':'; 167 *r++='2'; *r++='0'; *r++=':';
168 for(i=0;i<20;i+=4) WRITE32(r+=4,0,READ32(hash,i)); 168 for(i=0;i<20;i+=4) WRITE32(r,i,READ32(hash,i)); r+=20;
169
170 /* push rest of the scrape string */ 169 /* push rest of the scrape string */
171 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 ); 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 );
172 171
@@ -176,9 +175,10 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
176 r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count ); 175 r += sprintf( r, ":%zd:%zd\n", peer_list->seed_count, peer_list->peer_count-peer_list->seed_count );
177 break; 176 break;
178 case TASK_FULLSCRAPE_TPB_BINARY: 177 case TASK_FULLSCRAPE_TPB_BINARY:
179 for(i=0;i<20;i+=4) WRITE32(r+=4,0,READ32(hash,i)); 178 for(i=0;i<20;i+=4) WRITE32(r,i,READ32(hash,i)); r+=20;
180 *(uint32_t*)(r+=4) = htonl( (uint32_t) peer_list->seed_count ); 179 *(uint32_t*)(r+0) = htonl( (uint32_t) peer_list->seed_count );
181 *(uint32_t*)(r+=4) = htonl( (uint32_t)( peer_list->peer_count-peer_list->seed_count) ); 180 *(uint32_t*)(r+4) = htonl( (uint32_t)( peer_list->peer_count-peer_list->seed_count) );
181 r+=8;
182 break; 182 break;
183 case TASK_FULLSCRAPE_TPB_URLENCODED: 183 case TASK_FULLSCRAPE_TPB_URLENCODED:
184 r += fmt_urlencoded( r, (char *)*hash, 20 ); 184 r += fmt_urlencoded( r, (char *)*hash, 20 );