зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1418545: Don't fire OnDataAvailable for 0 bytes r=mayhemer
This commit is contained in:
Родитель
645a5d3db1
Коммит
8a5b70c6c2
|
@ -855,17 +855,19 @@ nsUnknownDecoder::ConvertEncodedData(nsIRequest* request,
|
|||
if (listener) {
|
||||
listener->OnStartRequest(request, nullptr);
|
||||
|
||||
nsCOMPtr<nsIStringInputStream> rawStream =
|
||||
do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID);
|
||||
if (!rawStream)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (length) {
|
||||
nsCOMPtr<nsIStringInputStream> rawStream =
|
||||
do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID);
|
||||
if (!rawStream)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
rv = rawStream->SetData((const char*)data, length);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = rawStream->SetData((const char*)data, length);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = listener->OnDataAvailable(request, nullptr, rawStream, 0,
|
||||
length);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = listener->OnDataAvailable(request, nullptr, rawStream, 0,
|
||||
length);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
listener->OnStopRequest(request, nullptr, NS_OK);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче