diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-28 19:46:59 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-28 19:46:59 +0100 |
| commit | adc518a2063ee78e4217a8aba51b116af1af42f4 (patch) | |
| tree | e5099842d850fffaef5bfd959822eeaa22599f55 /src/ot_fullscrape.c | |
| parent | cc7482269feb12c275a156efd42dd6a3d6cb189d (diff) | |
Add helper to pack uint32 in network byte order
Diffstat (limited to 'src/ot_fullscrape.c')
| -rw-r--r-- | src/ot_fullscrape.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ot_fullscrape.c b/src/ot_fullscrape.c index 0cd1910..3e3b6cb 100644 --- a/src/ot_fullscrape.c +++ b/src/ot_fullscrape.c | |||
| @@ -121,9 +121,8 @@ static void fullscrape_write_one( ot_tasktype mode, char **cursor, ot_torrent *t | |||
| 121 | case TASK_FULLSCRAPE_TPB_BINARY: | 121 | case TASK_FULLSCRAPE_TPB_BINARY: |
| 122 | memcpy(r, *hash, sizeof(ot_hash)); | 122 | memcpy(r, *hash, sizeof(ot_hash)); |
| 123 | r += sizeof(ot_hash); | 123 | r += sizeof(ot_hash); |
| 124 | *(uint32_t *)(r + 0) = htonl((uint32_t)seed_count); | 124 | pack_uint32(&r, (uint32_t)seed_count); |
| 125 | *(uint32_t *)(r + 4) = htonl((uint32_t)(peer_count - seed_count)); | 125 | pack_uint32(&r, (uint32_t)(peer_count - seed_count)); |
| 126 | r += 8; | ||
| 127 | break; | 126 | break; |
| 128 | case TASK_FULLSCRAPE_TPB_URLENCODED: | 127 | case TASK_FULLSCRAPE_TPB_URLENCODED: |
| 129 | r += urlencoded_format(r, *hash, sizeof(ot_hash)); | 128 | r += urlencoded_format(r, *hash, sizeof(ot_hash)); |
