Fix bustage.
authorDan Witte <dwitte@mozilla.com>
Thu, 12 Aug 2010 02:12:08 -0700
changeset 50562 d31ddf6547d748569f7d07a346b2179b157ff445
parent 50561 6bc7eea143ead4aee9344467f8f6a174aa0ac8d1
child 50563 6ee35465efab8cd76e59c4b0147241b3751d0690
push idunknown
push userunknown
push dateunknown
milestone2.0b4pre
Fix bustage.
netwerk/protocol/http/HttpChannelParent.cpp
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -287,22 +287,22 @@ nsresult
 HttpChannelParent::OnDataAvailable(nsIRequest *aRequest, 
                                    nsISupports *aContext, 
                                    nsIInputStream *aInputStream, 
                                    PRUint32 aOffset, 
                                    PRUint32 aCount)
 {
   LOG(("HttpChannelParent::OnDataAvailable [this=%x]\n", this));
  
-  nsresult rv;
-  rv = NS_ReadInputStreamToString(aInputStream, data, aCount);
-  if (NS_FAILED(rv) ||
-      bytesRead != aCount ||
-      mIPCClosed ||
-      !SendOnDataAvailable(data, aOffset, bytesRead))
+  nsCString data;
+  nsresult rv = NS_ReadInputStreamToString(aInputStream, data, aCount);
+  if (NS_FAILED(rv))
+    return rv;
+
+  if (mIPCClosed || !SendOnDataAvailable(data, aOffset, aCount))
     return NS_ERROR_UNEXPECTED; 
 
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::nsIProgressEventSink
 //-----------------------------------------------------------------------------