Bug 1130803 - Use non-blocking input for Fetch synthetization pipe, r=bkelly,ehsan
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 03 Mar 2015 10:16:00 +0100
changeset 231804 f222c7e15308
parent 231803 ffce258b2fee
child 231805 f124f6d08ec7
push id56362
push usercbook@mozilla.com
push dateWed, 04 Mar 2015 12:57:16 +0000
treeherdermozilla-inbound@f124f6d08ec7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly, ehsan
bugs1130803
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1130803 - Use non-blocking input for Fetch synthetization pipe, r=bkelly,ehsan
dom/fetch/FetchDriver.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -650,17 +650,19 @@ FetchDriver::OnStartRequest(nsIRequest* 
   // pipe has infinite space. The nsIChannel will continue to buffer data in
   // xpcom events even if we block on a fixed size pipe.  It might be possible
   // to suspend the channel and then resume when there is space available, but
   // for now use an infinite pipe to avoid blocking.
   nsCOMPtr<nsIInputStream> pipeInputStream;
   rv = NS_NewPipe(getter_AddRefs(pipeInputStream),
                   getter_AddRefs(mPipeOutputStream),
                   0, /* default segment size */
-                  UINT32_MAX /* infinite pipe */);
+                  UINT32_MAX /* infinite pipe */,
+                  true /* non-blocking input, otherwise you deadlock */,
+                  false /* blocking output, since the pipe is 'in'finite */ );
   if (NS_WARN_IF(NS_FAILED(rv))) {
     FailWithNetworkError();
     // Cancel request.
     return rv;
   }
 
   mResponse->SetBody(pipeInputStream);