diff --git a/include/simulator/simulator.hpp b/include/simulator/simulator.hpp index e9cc073..9fbaed4 100644 --- a/include/simulator/simulator.hpp +++ b/include/simulator/simulator.hpp @@ -1326,6 +1326,14 @@ namespace sim , seq_nr{0} {} + // this is move-only +#if LIBSIMULATOR_USE_MOVE + packet(packet const&) = delete; + packet& operator=(packet const&) = delete; + packet(packet&&) = default; + packet& operator=(packet&&) = default; +#endif + // to keep things simple, don't drop ACKs or errors bool ok_to_drop() const { diff --git a/src/tcp_socket.cpp b/src/tcp_socket.cpp index 3a5dee6..fc00584 100644 --- a/src/tcp_socket.cpp +++ b/src/tcp_socket.cpp @@ -499,9 +499,9 @@ namespace ip { // read, deliver the error if (total_received > 0) break; - m_incoming_queue.erase(m_incoming_queue.begin()); assert(p.ec); ec = p.ec; + m_incoming_queue.erase(m_incoming_queue.begin()); m_channel.reset(); return 0; }