diff options
| author | denis <> | 2007-03-17 01:24:56 +0000 |
|---|---|---|
| committer | denis <> | 2007-03-17 01:24:56 +0000 |
| commit | 57910440297afbcd760810a9bb6d8b9a5ee9b833 (patch) | |
| tree | e43e9db789cca848fb413b2889b9334a3fb12db2 | |
| parent | bab7c0bbb183e94ee89edb627e91f1e79220b66d (diff) | |
endianess fix for udp scrape
| -rw-r--r-- | trackerlogic.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index ff6f45a..c8576f6 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
| @@ -416,9 +416,7 @@ size_t return_udp_scrape_for_torrent( ot_hash *hash, char *reply ) { | |||
| 416 | 416 | ||
| 417 | if( !exactmatch ) { | 417 | if( !exactmatch ) { |
| 418 | memset( reply, 0, 12); | 418 | memset( reply, 0, 12); |
| 419 | } | 419 | } else { |
| 420 | else | ||
| 421 | { | ||
| 422 | unsigned long *r = (unsigned long*) reply; | 420 | unsigned long *r = (unsigned long*) reply; |
| 423 | clean_peerlist( NOW, torrent->peer_list ); | 421 | clean_peerlist( NOW, torrent->peer_list ); |
| 424 | 422 | ||
| @@ -426,9 +424,9 @@ size_t return_udp_scrape_for_torrent( ot_hash *hash, char *reply ) { | |||
| 426 | peers += torrent->peer_list->peers[i].size; | 424 | peers += torrent->peer_list->peers[i].size; |
| 427 | seeds += torrent->peer_list->seed_count[i]; | 425 | seeds += torrent->peer_list->seed_count[i]; |
| 428 | } | 426 | } |
| 429 | r[0] = seeds; | 427 | r[0] = htonl( seeds ); |
| 430 | r[1] = torrent->peer_list->downloaded; | 428 | r[1] = htonl( torrent->peer_list->downloaded ); |
| 431 | r[2] = peers-seeds; | 429 | r[2] = htonl( peers-seeds ); |
| 432 | } | 430 | } |
| 433 | return 12; | 431 | return 12; |
| 434 | } | 432 | } |
