summaryrefslogtreecommitdiff
path: root/ot_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_sync.c')
-rw-r--r--ot_sync.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/ot_sync.c b/ot_sync.c
index f958a20..f656bef 100644
--- a/ot_sync.c
+++ b/ot_sync.c
@@ -11,6 +11,7 @@
11#include <sys/uio.h> 11#include <sys/uio.h>
12 12
13/* Opentracker */ 13/* Opentracker */
14#include "ot_fmt.h"
14#include "ot_iovec.h" 15#include "ot_iovec.h"
15#include "ot_mutex.h" 16#include "ot_mutex.h"
16#include "ot_scan.h" 17#include "ot_scan.h"
@@ -109,14 +110,10 @@ static void sync_make(size_t *iovec_entries, struct iovec **iovector) {
109 re = r + OT_SYNC_CHUNK_SIZE; 110 re = r + OT_SYNC_CHUNK_SIZE;
110 } 111 }
111 112
112 *r++ = '2'; 113 fmt_append(&r, re, "20:");
113 *r++ = '0'; 114 fmt_bytes(&r, re, hash, sizeof(ot_hash));
114 *r++ = ':'; 115 fmt_append(&r, re, "%zd:", byte_count);
115 memmove(r, hash, sizeof(ot_hash)); 116 fmt_bytes(&r, re, peer_list->changeset.data, byte_count);
116 r += sizeof(ot_hash);
117 r += sprintf(r, "%zd:", byte_count);
118 memmove(r, peer_list->changeset.data, byte_count);
119 r += byte_count;
120 } 117 }
121 118
122 /* All torrents done: release lock on currenct bucket */ 119 /* All torrents done: release lock on currenct bucket */