From e267f38ace7ff6a4bd05fdede20cf3216183b3c0 Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Thu, 29 Mar 2001 02:34:19 +0000 Subject: [PATCH] Fixes bug 72348 "Page load performance slower in 0.8.1 than under 0.8" r/sr=dougt,brendan --- netwerk/base/src/nsStreamListenerProxy.cpp | 6 ++++++ netwerk/base/src/nsStreamObserverProxy.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/netwerk/base/src/nsStreamListenerProxy.cpp b/netwerk/base/src/nsStreamListenerProxy.cpp index e5b47efaa52..40dffd17d80 100644 --- a/netwerk/base/src/nsStreamListenerProxy.cpp +++ b/netwerk/base/src/nsStreamListenerProxy.cpp @@ -176,6 +176,12 @@ nsOnDataAvailableEvent::HandleEvent() rv = NS_ERROR_NOT_IMPLEMENTED; } + // Cancel the request on unexpected errors + if (NS_FAILED(rv) && (rv != NS_BASE_STREAM_CLOSED)) { + LOG(("OnDataAvailable failed [rv=%x] canceling request!\n")); + mRequest->Cancel(rv); + } + // // Update the listener status // diff --git a/netwerk/base/src/nsStreamObserverProxy.cpp b/netwerk/base/src/nsStreamObserverProxy.cpp index 681984774af..c7017a8a2c8 100644 --- a/netwerk/base/src/nsStreamObserverProxy.cpp +++ b/netwerk/base/src/nsStreamObserverProxy.cpp @@ -122,7 +122,12 @@ nsOnStartRequestEvent::HandleEvent() return NS_ERROR_FAILURE; } - return observer->OnStartRequest(mRequest, mContext); + nsresult rv = observer->OnStartRequest(mRequest, mContext); + if (NS_FAILED(rv)) { + LOG(("OnStartRequest failed [rv=%x] canceling request!\n", rv)); + mRequest->Cancel(rv); + } + return rv; } //