Bug 1562315 - Respect again=false indicated by http2 session when calling through TLSFilterTransaction, r=dragana

Differential Revision: https://phabricator.services.mozilla.com/D36384

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Honza Bambas 2019-07-01 14:26:34 +00:00
Родитель d430ca54b8
Коммит d056f02e32
2 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -356,18 +356,20 @@ nsresult TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader* aReader,
return NS_SUCCEEDED(rv) ? mReadSegmentReturnValue : rv;
}
nsresult TLSFilterTransaction::WriteSegments(nsAHttpSegmentWriter* aWriter,
uint32_t aCount,
uint32_t* outCountWritten) {
nsresult TLSFilterTransaction::WriteSegmentsAgain(nsAHttpSegmentWriter* aWriter,
uint32_t aCount,
uint32_t* outCountWritten,
bool* again) {
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
LOG(("TLSFilterTransaction::WriteSegments %p max=%d\n", this, aCount));
LOG(("TLSFilterTransaction::WriteSegmentsAgain %p max=%d\n", this, aCount));
if (!mTransaction) {
return NS_ERROR_UNEXPECTED;
}
mSegmentWriter = aWriter;
nsresult rv = mTransaction->WriteSegments(this, aCount, outCountWritten);
nsresult rv =
mTransaction->WriteSegmentsAgain(this, aCount, outCountWritten, again);
if (NS_SUCCEEDED(rv) && NS_FAILED(mFilterReadCode) && !(*outCountWritten)) {
// nsPipe turns failures into silent OK.. undo that!
rv = mFilterReadCode;
@ -381,6 +383,13 @@ nsresult TLSFilterTransaction::WriteSegments(nsAHttpSegmentWriter* aWriter,
return rv;
}
nsresult TLSFilterTransaction::WriteSegments(nsAHttpSegmentWriter* aWriter,
uint32_t aCount,
uint32_t* outCountWritten) {
bool again = false;
return WriteSegmentsAgain(aWriter, aCount, outCountWritten, &again);
}
nsresult TLSFilterTransaction::GetTransactionSecurityInfo(
nsISupports** outSecInfo) {
if (!mSecInfo) {

Просмотреть файл

@ -144,6 +144,10 @@ class TLSFilterTransaction final : public nsAHttpTransaction,
NullHttpTransaction* QueryNullTransaction() override;
nsHttpTransaction* QueryHttpTransaction() override;
SpdyConnectTransaction* QuerySpdyConnectTransaction() override;
MOZ_MUST_USE nsresult WriteSegmentsAgain(nsAHttpSegmentWriter* writer,
uint32_t count,
uint32_t* countWritten,
bool* again) override;
private:
MOZ_MUST_USE nsresult StartTimerCallback();