Hold the incoming connection before exercising DOWN callbacks
This commit is contained in:
1 parent
bd9f1bb0c9
commit
f1e3c2c08a
1 file changed
+6
-2
@@ -298,8 +298,9 @@ static void close_from_link_event(struct ETCP_CONN *conn, struct ETCP_LINK *link
|
||||
int selected = test->on_down ? old_status && !link->link_status :
|
||||
link->initialized && link->link_status && old_state != LINK_STATE_CONNECTED;
|
||||
if (!selected) return;
|
||||
test->fired++; test->victim = link; test->retained = conn;
|
||||
CHECK(etcp_conn_ref_take(conn) == 0);
|
||||
test->fired++; test->victim = link;
|
||||
if (!test->retained) { CHECK(etcp_conn_ref_take(conn) == 0); test->retained = conn; }
|
||||
CHECK(test->retained == conn);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "TCP callback close: action=%u down=%u peer=%016llx path=%u old=%d/%d new=%u/%u",
|
||||
test->action, test->on_down, (unsigned long long)conn->peer_node_id, link->local_link_id,
|
||||
old_state, old_status, link->link_state, link->link_status);
|
||||
@@ -325,6 +326,9 @@ static void callback_close_case(int reality, int side, unsigned action, unsigned
|
||||
}
|
||||
if (on_down) {
|
||||
wait_pair(); exchange_messages();
|
||||
hold_connection(side); /* Входящий транспорт тоже имеет живого владельца при EOF. */
|
||||
test.retained = endpoints[side].conn;
|
||||
CHECK(etcp_conn_ref_take(test.retained) == 0);
|
||||
etcp_add_link_status_cbk(endpoints[side].inst, close_from_link_event, &test);
|
||||
stop_endpoint(1 - side);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user