Backed out changeset 5d8c20358cac (bug 756165) for [@ MOZ_CrashOOL] crashes on a CLOSED TREE

This commit is contained in:
Andreea Pavel
2018-06-28 03:00:49 +03:00
parent e81c861f4a
commit f1ddf7dbee
2 changed files with 2 additions and 29 deletions

View File

@@ -59,7 +59,6 @@
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "nsSocketTransportService2.h"
#include "nsINSSErrorsService.h"
#include "plbase64.h"
#include "prmem.h"
@@ -3818,25 +3817,9 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest,
rv = mHttpChannel->GetResponseStatus(&status);
if (NS_FAILED(rv)) {
nsresult httpStatus;
rv = NS_ERROR_CONNECTION_REFUSED;
// If we failed to connect due to unsuccessful TLS handshake, we must
// propagate that error to mozilla::dom::WebSocketImpl so it can set
// status code to 1015. Otherwise return NS_ERROR_CONNECTION_REFUSED.
if (NS_SUCCEEDED(mHttpChannel->GetStatus(&httpStatus))) {
uint32_t errorClass;
nsCOMPtr<nsINSSErrorsService> errSvc =
do_GetService("@mozilla.org/nss_errors_service;1");
// If GetErrorClass succeeds httpStatus is TLS related failure.
if (errSvc && NS_SUCCEEDED(errSvc->GetErrorClass(httpStatus, &errorClass))) {
rv = httpStatus;
}
}
LOG(("WebSocketChannel::OnStartRequest: No HTTP Response\n"));
AbortSession(rv);
return rv;
AbortSession(NS_ERROR_CONNECTION_REFUSED);
return NS_ERROR_CONNECTION_REFUSED;
}
LOG(("WebSocketChannel::OnStartRequest: HTTP status %d\n", status));