[*] AuNet: Missing Linux TODO block; harden two callbacks missing a try/catch
This commit is contained in:
parent
3bae761e50
commit
592afe00a7
@ -18,6 +18,8 @@
|
||||
|
||||
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
||||
#include "AuNetStream.NT.hpp"
|
||||
#else
|
||||
#include "AuNetStream.Linux.hpp"
|
||||
#endif
|
||||
|
||||
namespace Aurora::IO::Net
|
||||
@ -694,9 +696,18 @@ namespace Aurora::IO::Net
|
||||
|
||||
this->socketChannel_.outputChannel.pParent_ = nullptr;
|
||||
#else
|
||||
// TODO:
|
||||
#endif
|
||||
if (this->socketChannel_.inputChannel.pNetReadTransaction)
|
||||
{
|
||||
AuStaticCast<LinuxAsyncNetworkTransaction>(this->socketChannel_.inputChannel.pNetReadTransaction)->pSocket = nullptr;
|
||||
}
|
||||
|
||||
this->socketChannel_.inputChannel.pNetReadTransaction.reset();
|
||||
|
||||
if (pWriteTransaction)
|
||||
{
|
||||
AuStaticCast<LinuxAsyncNetworkTransaction>(pWriteTransaction)->pSocket = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
this->CloseSocket();
|
||||
}
|
||||
|
@ -585,6 +585,11 @@ namespace Aurora::IO::Net
|
||||
{
|
||||
this->StopTime();
|
||||
|
||||
if (this->inputChannel.pNetReader)
|
||||
{
|
||||
this->inputChannel.pNetReader->End();
|
||||
}
|
||||
|
||||
this->PrivateUserDataClear();
|
||||
|
||||
this->pCachedReader.reset();
|
||||
|
@ -79,7 +79,6 @@ namespace Aurora::IO::Net
|
||||
void SocketChannelInput::WarmOnEstablish()
|
||||
{
|
||||
auto sharedThis = AuSPtr<SocketChannelInput>(this->pParent_->SharedFromThis(), this);
|
||||
|
||||
AuIO::IOPipeRequestAIO req;
|
||||
req.output.handleBufferedStream.pOnData = AuUnsafeRaiiToShared(this);
|
||||
req.output.type = EPipeCallbackType::eTryHandleBufferedPart;
|
||||
|
@ -69,6 +69,11 @@ namespace Aurora::IO::Net
|
||||
const AuSPtr<INetWorker> &pWorker)
|
||||
{
|
||||
this->pSocket = that;
|
||||
if (!this->pEvent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
auto bStatus = pWorker->ToProcessor()->StartSimpleLSWatchEx(this->pEvent,
|
||||
AuSPtr<AuIO::IIOSimpleEventListener>(that, this),
|
||||
true);
|
||||
|
@ -379,9 +379,24 @@ namespace Aurora::IO::Net
|
||||
}
|
||||
|
||||
if (this->pSub)
|
||||
{
|
||||
try
|
||||
{
|
||||
this->pSub->OnAsyncFileOpFinished(this->dwLastAbstractOffset, read);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SysPushErrorCatch();
|
||||
}
|
||||
}
|
||||
|
||||
if (!read)
|
||||
{
|
||||
if (this->pSocket)
|
||||
{
|
||||
this->pSocket->SendEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int LinuxAsyncNetworkTransaction::GetSocket()
|
||||
|
@ -550,9 +550,16 @@ namespace Aurora::IO::Net
|
||||
}
|
||||
|
||||
if (this->pSub)
|
||||
{
|
||||
try
|
||||
{
|
||||
this->pSub->OnAsyncFileOpFinished(this->dwLastAbstractOffset, read);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SysPushErrorCatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET NtAsyncNetworkTransaction::GetSocket()
|
||||
|
Loading…
Reference in New Issue
Block a user