Bug 1416879 - Part 1: DivertComplete should only be sent at OnStopRequest for synthesized responses. r=bkelly

Diversion for intercepted channels with a synthesized response is a
special case.  It is not appropriate to send DivertComplete when
mEventQ has been drained, because we are not dealing with the usual
mEventQ-enqueued OnDataAvailable payloads that had been received over
the network and sent down to the child.  In this case, all the data
originates in the child and does not go through mEventQ.  As such,
the correct place to send DivertComplete is at OnStopComplete for the
synthesized response.

--HG--
extra : rebase_source : 2209c25ad6f2b5655728d8dc07ef7f8b64df6ea6
This commit is contained in:
Andrew Sutherland 2018-01-04 18:56:46 -05:00
Родитель 64ef60ebaa
Коммит 7f86d0ce4a
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -644,6 +644,7 @@ public:
nsresult aStatus) override
{
mChannel->SendDivertOnStopRequest(aStatus);
mChannel->SendDivertComplete();
return NS_OK;
}
@ -1882,7 +1883,11 @@ HttpChannelChild::FlushedForDiversion()
// received from the parent channel, nor dequeued from the ChannelEventQueue.
mFlushedForDiversion = true;
SendDivertComplete();
// If we're synthesized, it's up to the SyntheticDiversionListener to invoke
// SendDivertComplete after it has sent the DivertOnStopRequestMessage.
if (!mSynthesizedResponse) {
SendDivertComplete();
}
}
void