After eyeballing lingering requests, clean up requests after the response to an async (non-streaming) request is done.

This commit is contained in:
Cory McWilliams 2024-05-02 19:37:38 -04:00
parent f01f7a5ab9
commit 929ae1b709

View File

@ -785,7 +785,7 @@ void tf_ssb_connection_rpc_send(tf_ssb_connection_t* connection, uint8_t flags,
_tf_ssb_connection_box_stream_send(connection, combined, 1 + 2 * sizeof(uint32_t) + size);
tf_free(combined);
connection->ssb->rpc_out++;
if (flags & k_ssb_rpc_flag_end_error)
if ((flags & k_ssb_rpc_flag_end_error) || (request_number < 0 && !(flags & k_ssb_rpc_flag_stream)))
{
tf_ssb_connection_remove_request(connection, request_number);
}
@ -1551,6 +1551,10 @@ static void _tf_ssb_connection_rpc_recv(tf_ssb_connection_t* connection, uint8_t
callback(connection, flags, request_number, val, message, size, user_data);
POST_CALLBACK(connection->ssb, callback);
tf_trace_end(connection->ssb->trace);
if (!(flags & k_ssb_rpc_flag_stream))
{
tf_ssb_connection_remove_request(connection, -request_number);
}
}
}
else if (JS_IsObject(val))