bug 1110707 - dont assume seekable stream on sending_to http events r=valentin a=sylvestre
authorPatrick McManus <mcmanus@ducksong.com>
Mon, 09 Feb 2015 10:03:30 -0500
changeset 243709 222d4a9f7ed3
parent 243708 ced08a06e2d1
child 243710 581876946dcf
push id4447
push usermcmanus@ducksong.com
push date2015-02-09 15:04 +0000
treeherdermozilla-beta@222d4a9f7ed3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, sylvestre
bugs1110707
milestone36.0
bug 1110707 - dont assume seekable stream on sending_to http events r=valentin a=sylvestre
netwerk/protocol/http/nsHttpTransaction.cpp
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -546,21 +546,28 @@ nsHttpTransaction::OnTransportStatus(nsI
     // nsHttpChannel synthesizes progress events in OnDataAvailable
     if (status == NS_NET_STATUS_RECEIVING_FROM)
         return;
 
     uint64_t progressMax;
 
     if (status == NS_NET_STATUS_SENDING_TO) {
         // suppress progress when only writing request headers
-        if (!mHasRequestBody)
+        if (!mHasRequestBody) {
+            LOG(("nsHttpTransaction::OnTransportStatus %p "
+                 "SENDING_TO without request body\n", this));
             return;
+        }
 
         nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mRequestStream);
-        MOZ_ASSERT(seekable, "Request stream isn't seekable?!?");
+        if (!seekable) {
+            LOG(("nsHttpTransaction::OnTransportStatus %p "
+                 "SENDING_TO without seekable request stream\n", this));
+            return;
+        }
 
         int64_t prog = 0;
         seekable->Tell(&prog);
         progress = prog;
 
         // when uploading, we include the request headers in the progress
         // notifications.
         progressMax = mRequestSize; // XXX mRequestSize is 32-bit!