"vscode:/vscode.git/clone" did not exist on "1dcb8dae5b94e4af56d023cce359e52657d0d14e"
Commit 0c0fbcbd authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

dist/sockets: validate postion when sending entries (for debug)

parent 59abd0fd
...@@ -499,6 +499,13 @@ int NetOpPassEntries(struct Peer *peer, uint32_t pos, uint32_t n) { ...@@ -499,6 +499,13 @@ int NetOpPassEntries(struct Peer *peer, uint32_t pos, uint32_t n) {
abort(); abort();
} }
if ((peer->last_sent_pos + 1) % peer->local_enum != pos) {
fprintf(stderr, "NetOpPassEntries: entry sent repeatedly: p=%u n=%u\n",
pos, n);
abort();
}
peer->last_sent_pos = pos + n - 1;
struct SockMsg *msg = SockMsgAlloc(); struct SockMsg *msg = SockMsgAlloc();
if (!msg) if (!msg)
return 1; return 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment