Bug 1271527 - Crash in mozilla::net::WebSocketChannel::Notify, r=mcmanus
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 12 May 2016 13:28:50 +0200
changeset 297182 6f5d73b492f87b0594536c5d4116610b56617277
parent 297181 d5eac62c7880b9450642620eb241427ec151eb49
child 297183 4e86f3f05b07184e777440a7b3f99803e8ea153d
push id30253
push usercbook@mozilla.com
push dateFri, 13 May 2016 09:59:43 +0000
treeherdermozilla-central@5a2deb5a9b09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1271527
milestone49.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 1271527 - Crash in mozilla::net::WebSocketChannel::Notify, r=mcmanus
netwerk/protocol/websocket/WebSocketChannel.cpp
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -3128,19 +3128,19 @@ WebSocketChannel::Notify(nsITimer *timer
     }
 
     if (!mPingOutstanding) {
       // Ping interval must be non-null or PING was forced by OnNetworkChanged()
       MOZ_ASSERT(mPingInterval || mPingForced);
       LOG(("nsWebSocketChannel:: Generating Ping\n"));
       mPingOutstanding = 1;
       mPingForced = 0;
-      GeneratePing();
       mPingTimer->InitWithCallback(this, mPingResponseTimeout,
                                    nsITimer::TYPE_ONE_SHOT);
+      GeneratePing();
     } else {
       LOG(("nsWebSocketChannel:: Timed out Ping\n"));
       mPingTimer = nullptr;
       AbortSession(NS_ERROR_NET_TIMEOUT);
     }
   } else if (timer == mLingeringCloseTimer) {
     LOG(("WebSocketChannel:: Lingering Close Timer"));
     CleanupConnection();