[*] Fix Win32 pipe regression

[*] Fix Win32 network regression
This commit is contained in:
Reece Wilson 2024-09-21 10:42:44 +01:00
parent ff65193d0f
commit 9b1ff8889e
5 changed files with 37 additions and 25 deletions

View File

@ -127,19 +127,22 @@ namespace Aurora::IO
if (this->pAsyncTransaction_) if (this->pAsyncTransaction_)
{ {
auto pWaitable = this->pAsyncAdapter_->ToWaitable(); if (!this->bShouldBypassIOWatch)
if (pWaitable)
{ {
ret = this->parent_->parent_->StartIOWatch(pWaitable, AuSharedFromThis()); auto pWaitable = this->pAsyncAdapter_->ToWaitable();
if (!ret) if (pWaitable)
{
ret = this->parent_->parent_->StartIOWatch(pWaitable, AuSharedFromThis());
if (!ret)
{
return false;
}
}
else
{ {
return false; return false;
} }
} }
else
{
return false;
}
} }
else else
{ {

View File

@ -103,7 +103,8 @@ namespace Aurora::IO
AuMemoryViewWrite nextWriteAsync_; AuMemoryViewWrite nextWriteAsync_;
IOPipeRequest request {}; IOPipeRequest request {};
bool bShouldReadNext {false}; bool bShouldReadNext { false };
bool bShouldBypassIOWatch { false };
bool IsAtRequestedEnd(); bool IsAtRequestedEnd();
AuByteBuffer *GetBuffer(); AuByteBuffer *GetBuffer();

View File

@ -598,8 +598,6 @@ namespace Aurora::IO::FS
{ {
DWORD read {}; DWORD read {};
this->dwLastAbstractStat = 0;
if (this->isIrredeemable_) if (this->isIrredeemable_)
{ {
::ResetEvent(this->event); ::ResetEvent(this->event);

View File

@ -99,11 +99,7 @@ namespace Aurora::IO::Net
return; return;
} }
if (!pReader->Start()) AuStaticCast<IOPipeWork>(pReader)->bShouldBypassIOWatch = true;
{
this->pParent_->SendErrorNoStream({});
return;
}
auto pTX = this->pNetReadTransaction; auto pTX = this->pNetReadTransaction;
if (!pTX) if (!pTX)
@ -112,7 +108,14 @@ namespace Aurora::IO::Net
return; return;
} }
pTX->SetCallback(sharedThis);//; AuSPtr<IAsyncFinishedSubscriber>(this->pParent_->SharedFromThis(), this)); pTX->SetCallback(sharedThis);
if (!pReader->Start())
{
this->pParent_->SendErrorNoStream({});
return;
}
IncrementWorker(); IncrementWorker();
} }

View File

@ -434,7 +434,8 @@ namespace Aurora::IO::Net
bool NtAsyncNetworkTransaction::HasCompleted() bool NtAsyncNetworkTransaction::HasCompleted()
{ {
return this->bHasFailed || return this->bHasFailed ||
this->dwLastBytes; this->dwLastBytes ||
this->bLatch;
} }
AuUInt NtAsyncNetworkTransaction::GetOSErrorCode() AuUInt NtAsyncNetworkTransaction::GetOSErrorCode()
@ -461,18 +462,24 @@ namespace Aurora::IO::Net
{ {
AuLoop::ILSEvent *optEvent {}; AuLoop::ILSEvent *optEvent {};
if (auto pLoopSource = this->pCompletionGroup_->GetTriggerLoopSource()) if (auto pCompletionGroup = this->pCompletionGroup_)
{ {
return pLoopSource; if (auto pLoopSource = pCompletionGroup->GetTriggerLoopSource())
}
else
{
if (auto pWaitable = this->pWaitable)
{ {
return pWaitable; return pLoopSource;
} }
} }
if (auto pWaitable = this->pWaitable)
{
return pWaitable;
}
if (auto pSocket = this->pSocket)
{
return AuStaticCast<AuLoop::LSEvent>(pSocket->ToWorkerEx()->ToEvent());
}
return {}; return {};
} }