Skip to content

Commit

Permalink
tcp: fix assertion failure on connection reset
Browse files Browse the repository at this point in the history
The connection reset code posted an exception on the _data_received promise
to break a waiter (if any), but left the optional<promise<>> engaged.  This
caused the connection destructor to attempt to post a new exception on the
same promise, which is not legal.

Fix by disengaging the optional promise, and give the same treatment to
_all_data_acked_promise.
  • Loading branch information
avikivity committed Jul 13, 2015
1 parent d162922 commit 66451d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tcp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,11 @@ private:
cleanup();
if (_rcv._data_received_promise) {
_rcv._data_received_promise->set_exception(tcp_reset_error());
_rcv._data_received_promise = std::experimental::nullopt;
}
if (_snd._all_data_acked_promise) {
_snd._all_data_acked_promise->set_exception(tcp_reset_error());
_snd._all_data_acked_promise = std::experimental::nullopt;
}
}
void do_time_wait() {
Expand Down

0 comments on commit 66451d5

Please sign in to comment.