mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1029163 - part 3 tunnel https/h1 over h2 could duplicate bytes in upload and corrupt data r=hurley
This commit is contained in:
parent
064aa10644
commit
926e563e62
@ -200,15 +200,19 @@ TLSFilterTransaction::OnReadSegment(const char *aData,
|
||||
|
||||
uint32_t amt = 0;
|
||||
if (mEncryptedTextUsed) {
|
||||
// If we are tunneled on spdy CommitToSegmentSize will prevent partial
|
||||
// writes that could interfere with multiplexing. H1 is fine with
|
||||
// partial writes.
|
||||
rv = mSegmentReader->CommitToSegmentSize(mEncryptedTextUsed, mForce);
|
||||
if (rv != NS_BASE_STREAM_WOULD_BLOCK) {
|
||||
rv = mSegmentReader->OnReadSegment(mEncryptedText, mEncryptedTextUsed, &amt);
|
||||
}
|
||||
|
||||
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
|
||||
// return OK because all the data was consumed and stored in this buffer
|
||||
Connection()->TransactionHasDataToWrite(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
rv = mSegmentReader->OnReadSegment(mEncryptedText, mEncryptedTextUsed, &amt);
|
||||
if (NS_FAILED(rv)) {
|
||||
} else if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
@ -220,7 +224,6 @@ TLSFilterTransaction::OnReadSegment(const char *aData,
|
||||
} else {
|
||||
memmove(mEncryptedText, mEncryptedText + amt, mEncryptedTextUsed - amt);
|
||||
mEncryptedTextUsed -= amt;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user