help with bug #237623 and a failing mochitest

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

help with bug #237623 and a failing mochitest

Daniel Stenberg
Hi all!

I'm working on this bug and I pushed a patch to the try server the other day.
I so wanted to get it merged before its 10th anniversay but I failed.

The patch makes some prematurely interrupted HTTP transfers generate errors
where they previously would just be silently fine.

I got a failed mochitest for this patch that is confusing me. That failing
test is called "netwerk/test/mochitests/test_partially_cached_content.html".

I can make the test go through by applying the (ugly) patch I'll show you
below that modifies nsPipeOutputStream::CloseWithStatus() but I don't consider
it to be a correct change.

As I'm a newbie in general in Firefox land and even more so in mochitest and
javascript, can anyone throw me something that can help me figure this one
out?

Here's the ugly hack that can make the test succeed:

--- a/xpcom/io/nsPipe3.cpp
+++ b/xpcom/io/nsPipe3.cpp
@@ -1055,11 +1055,11 @@ nsPipeOutputStream::Release()
  NS_IMETHODIMP
  nsPipeOutputStream::CloseWithStatus(nsresult reason)
  {
      LOG(("OOO CloseWithStatus [this=%x reason=%x]\n", this, reason));

-    if (NS_SUCCEEDED(reason))
+    if (NS_SUCCEEDED(reason) || (reason == NS_ERROR_NET_INTERRUPT))
          reason = NS_BASE_STREAM_CLOSED;

      // input stream may remain open
      mPipe->OnPipeException(reason, true);
      return NS_OK;


--

  / daniel.haxx.se
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help with bug #237623 and a failing mochitest

Christian Biesinger-2
Hi Daniel,

don't have time to read through the test right now, but perhaps you
need to modify nsHttpChannel>>CloseCacheEntry?
http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpChannel.cpp#3611

-christian

On Thu, Mar 20, 2014 at 6:05 AM, Daniel Stenberg <[hidden email]> wrote:

> Hi all!
>
> I'm working on this bug and I pushed a patch to the try server the other
> day. I so wanted to get it merged before its 10th anniversay but I failed.
>
> The patch makes some prematurely interrupted HTTP transfers generate errors
> where they previously would just be silently fine.
>
> I got a failed mochitest for this patch that is confusing me. That failing
> test is called "netwerk/test/mochitests/test_partially_cached_content.html".
>
> I can make the test go through by applying the (ugly) patch I'll show you
> below that modifies nsPipeOutputStream::CloseWithStatus() but I don't
> consider it to be a correct change.
>
> As I'm a newbie in general in Firefox land and even more so in mochitest and
> javascript, can anyone throw me something that can help me figure this one
> out?
>
> Here's the ugly hack that can make the test succeed:
>
> --- a/xpcom/io/nsPipe3.cpp
> +++ b/xpcom/io/nsPipe3.cpp
> @@ -1055,11 +1055,11 @@ nsPipeOutputStream::Release()
>  NS_IMETHODIMP
>  nsPipeOutputStream::CloseWithStatus(nsresult reason)
>  {
>      LOG(("OOO CloseWithStatus [this=%x reason=%x]\n", this, reason));
>
> -    if (NS_SUCCEEDED(reason))
> +    if (NS_SUCCEEDED(reason) || (reason == NS_ERROR_NET_INTERRUPT))
>          reason = NS_BASE_STREAM_CLOSED;
>
>      // input stream may remain open
>      mPipe->OnPipeException(reason, true);
>      return NS_OK;
>
>
> --
>
>  / daniel.haxx.se
> _______________________________________________
> dev-tech-network mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-network
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Loading...