Closed Sjors closed 3 days ago
Thanks. I'll apply your changes as well as the test clarifications.
Folded all of it into #50! Left a few followup questions there.
Additionally I fixed a few locking warnings and implemented EventGotEOF
and EventGotPermanentReadError
to just disconnect.
Yo! There are two problems here:
Sv2Connman::EventReadyToSend()
it forgot to erase the sent message from the queue, so it kept sending the same message over and over again. Fixed by addingclient->m_send_messages.erase()
. This fixes the failure ofBOOST_REQUIRE_EQUAL(tester.LocalToRemoteBytes(), SV2_HEADER_ENCRYPTED_SIZE + 6 + Poly1305::TAGLEN);
SockMan
. Fixed by addinginterruptNet()
inSv2Connman::Interrupt()
.Here is a patch: sv2sockman.diff.txt
The changes to
sv2_connman_tests.cpp
are not needed for the test to pass but I made them to unconfuse myself from the send vs recv interaction - since both ends of the connection are inside one program, I was confused what does it mean to "send" bytes. So I renamed a bunch of symbols to use the notation of "local" and "remote" and "local to remote" and "remote to local". Another possibility would be to use "us" and "them", e.g. "from us to them" and "from them to us". Feel free to ignore those.