зеркало из https://github.com/microsoft/CCF.git
Fix `connections_test_cft` crashes in multi-threaded CI (#2715)
This commit is contained in:
Родитель
e922df75ac
Коммит
1d3a313440
|
@ -1 +1 @@
|
|||
chchirpirpp
|
||||
cheep
|
|
@ -50,7 +50,23 @@ namespace enclave
|
|||
enclave::TLSEndpoint(session_id, writer_factory, std::move(ctx))
|
||||
{}
|
||||
|
||||
static void recv_cb(std::unique_ptr<threading::Tmsg<SendRecvMsg>> msg)
|
||||
{
|
||||
reinterpret_cast<NoMoreSessionsEndpointImpl*>(msg->data.self.get())
|
||||
->recv_(msg->data.data.data(), msg->data.data.size());
|
||||
}
|
||||
|
||||
void recv(const uint8_t* data, size_t size) override
|
||||
{
|
||||
auto msg = std::make_unique<threading::Tmsg<SendRecvMsg>>(&recv_cb);
|
||||
msg->data.self = this->shared_from_this();
|
||||
msg->data.data.assign(data, data + size);
|
||||
|
||||
threading::ThreadMessaging::thread_messaging.add_task(
|
||||
execution_thread, std::move(msg));
|
||||
}
|
||||
|
||||
void recv_(const uint8_t* data, size_t size)
|
||||
{
|
||||
recv_buffered(data, size);
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace enclave
|
|||
{
|
||||
if (threading::get_current_thread_id() != execution_thread)
|
||||
{
|
||||
throw std::exception();
|
||||
throw std::runtime_error("Called recv_buffered from incorrect thread");
|
||||
}
|
||||
pending_read.insert(pending_read.end(), data, data + size);
|
||||
do_handshake();
|
||||
|
|
Загрузка…
Ссылка в новой задаче