mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Bug #89606 --> don't call ODA if we don't have any bytes in the input stream.
fixes a crash on linux. r=bienvenu sr=sspitzer
This commit is contained in:
parent
8771e69f40
commit
0aac614070
@ -70,11 +70,16 @@ static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
|||||||
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||||
static NS_DEFINE_CID(kCMimeConverterCID, NS_MIME_CONVERTER_CID);
|
static NS_DEFINE_CID(kCMimeConverterCID, NS_MIME_CONVERTER_CID);
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS4(nsMimeBaseEmitter,
|
NS_IMPL_THREADSAFE_ADDREF(nsMimeBaseEmitter)
|
||||||
nsIMimeEmitter,
|
NS_IMPL_THREADSAFE_RELEASE(nsMimeBaseEmitter)
|
||||||
nsIInputStreamObserver,
|
|
||||||
nsIOutputStreamObserver,
|
NS_INTERFACE_MAP_BEGIN(nsMimeBaseEmitter)
|
||||||
nsIInterfaceRequestor)
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIMimeEmitter)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsIMimeEmitter)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsIInputStreamObserver)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsIOutputStreamObserver)
|
||||||
|
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||||
|
NS_INTERFACE_MAP_END
|
||||||
|
|
||||||
nsMimeBaseEmitter::nsMimeBaseEmitter()
|
nsMimeBaseEmitter::nsMimeBaseEmitter()
|
||||||
{
|
{
|
||||||
@ -291,8 +296,8 @@ NS_IMETHODIMP nsMimeBaseEmitter::OnFull(nsIOutputStream* out)
|
|||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Available failed");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "Available failed");
|
||||||
|
|
||||||
nsCOMPtr<nsIRequest> request = do_QueryInterface(mChannel);
|
nsCOMPtr<nsIRequest> request = do_QueryInterface(mChannel);
|
||||||
|
|
||||||
rv = mOutListener->OnDataAvailable(request, mURL, mInputStream, 0, bytesAvailable);
|
rv = mOutListener->OnDataAvailable(request, mURL, mInputStream, 0, bytesAvailable);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rv = NS_ERROR_NULL_POINTER;
|
rv = NS_ERROR_NULL_POINTER;
|
||||||
@ -880,12 +885,14 @@ nsMimeBaseEmitter::Complete()
|
|||||||
|
|
||||||
if (mOutListener)
|
if (mOutListener)
|
||||||
{
|
{
|
||||||
PRUint32 bytesInStream;
|
PRUint32 bytesInStream = 0;
|
||||||
nsresult rv2 = mInputStream->Available(&bytesInStream);
|
nsresult rv2 = mInputStream->Available(&bytesInStream);
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv2), "Available failed");
|
NS_ASSERTION(NS_SUCCEEDED(rv2), "Available failed");
|
||||||
nsCOMPtr<nsIRequest> request = do_QueryInterface(mChannel);
|
if (bytesInStream)
|
||||||
rv2 = mOutListener->OnDataAvailable(request, mURL, mInputStream, 0, bytesInStream);
|
{
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv2), "OnDataAvailable failed");
|
nsCOMPtr<nsIRequest> request = do_QueryInterface(mChannel);
|
||||||
|
rv2 = mOutListener->OnDataAvailable(request, mURL, mInputStream, 0, bytesInStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user