[*] protocol stack: hardening of buffer flags
This commit is contained in:
parent
08c37454fe
commit
dfe6b468ec
@ -77,7 +77,13 @@ namespace Aurora::IO::Protocol
|
||||
}
|
||||
}
|
||||
|
||||
return this->outputBuffer.Resize(uOutputLength);
|
||||
this->outputBuffer.flagNoFree = false;
|
||||
auto bRet = this->outputBuffer.Resize(uOutputLength);
|
||||
if (!this->uMax.has_value())
|
||||
{
|
||||
this->outputBuffer.flagNoFree = true;
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
void ProtocolPiece::Remove()
|
||||
|
@ -120,6 +120,8 @@ namespace Aurora::IO::Protocol
|
||||
return {};
|
||||
}
|
||||
|
||||
pNew->outputBuffer.flagNoFree = true;
|
||||
|
||||
// Circular ref
|
||||
pNew->pOuputWriter = AuMakeShared<AuIO::Buffered::BlobWriter>(AuSPtr<Memory::ByteBuffer>(pNew, &pNew->outputBuffer));
|
||||
|
||||
@ -136,7 +138,7 @@ namespace Aurora::IO::Protocol
|
||||
|
||||
EStreamError Write(const Memory::MemoryViewStreamRead ¶meters) override
|
||||
{
|
||||
return pStack.lock()->DoTick(AuMakeShared<AuByteBuffer>(parameters), pParent.lock()) ?
|
||||
return pStack.lock()->DoTick(AuMakeSharedThrow<AuByteBuffer>(parameters), pParent.lock()) ?
|
||||
EStreamError::eErrorNone :
|
||||
EStreamError::eErrorStreamInterrupted;
|
||||
}
|
||||
@ -254,6 +256,10 @@ namespace Aurora::IO::Protocol
|
||||
pNew->uMax = uMax;
|
||||
pNew->outputBuffer.flagAlwaysExpandable = pNew->outputBuffer.flagExpandable = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pNew->outputBuffer.flagNoFree = true;
|
||||
}
|
||||
|
||||
pNew->uStartingSize = uOutputBufferSize;
|
||||
|
||||
@ -273,7 +279,7 @@ namespace Aurora::IO::Protocol
|
||||
|
||||
EStreamError Write(const Memory::MemoryViewStreamRead ¶meters) override
|
||||
{
|
||||
return pStack.lock()->DoTick(AuMakeShared<AuByteBuffer>(parameters), pParent.lock()) ?
|
||||
return pStack.lock()->DoTick(AuMakeSharedThrow<AuByteBuffer>(parameters), pParent.lock()) ?
|
||||
EStreamError::eErrorNone :
|
||||
EStreamError::eErrorStreamInterrupted;
|
||||
}
|
||||
@ -384,7 +390,7 @@ namespace Aurora::IO::Protocol
|
||||
|
||||
EStreamError Write(const Memory::MemoryViewStreamRead ¶meters) override
|
||||
{
|
||||
return pStack.lock()->DoTick(AuMakeShared<AuByteBuffer>(parameters), pParent.lock()) ?
|
||||
return pStack.lock()->DoTick(AuMakeSharedThrow<AuByteBuffer>(parameters), pParent.lock()) ?
|
||||
EStreamError::eErrorNone :
|
||||
EStreamError::eErrorStreamInterrupted;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user