1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-26 01:59:53 +03:00

Merge PR #1441: Mayaqua/Network.c: Fix race condition in TUBE operation

This commit is contained in:
Davide Beatrici 2021-07-23 19:42:13 +02:00 committed by GitHub
commit 101d79d7c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16732,8 +16732,12 @@ bool TubeSendEx2(TUBE *t, void *data, UINT size, void *header, bool no_flush, UI
if (no_flush == false)
{
Set(t->Event);
SetSockEvent(t->SockEvent);
Lock(t->Lock);
{
Set(t->Event);
SetSockEvent(t->SockEvent);
}
Unlock(t->Lock);
}
return true;
@ -16765,8 +16769,12 @@ void TubeFlushEx(TUBE *t, bool force)
}
}
Set(t->Event);
SetSockEvent(t->SockEvent);
Lock(t->Lock);
{
Set(t->Event);
SetSockEvent(t->SockEvent);
}
Unlock(t->Lock);
}
// Receive the data from the tube (asynchronous)