Bug 1271527 - Crash in mozilla::net::WebSocketChannel::Notify, r=mcmanus a=ritu
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 12 May 2016 13:28:50 +0200
changeset 324385 e9f19fa05b85d174e24a722d91a995551684a9c1
parent 324384 4effff0358e5018eb7772b491b3c7a77ef004f3c
child 324386 a9e1d0bc8a8c542d083a5f51c5d3cc22721db9c2
push id5992
push userkwierso@gmail.com
push dateSat, 14 May 2016 00:16:42 +0000
treeherdermozilla-beta@a9e1d0bc8a8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, ritu
bugs1271527
milestone47.0
Bug 1271527 - Crash in mozilla::net::WebSocketChannel::Notify, r=mcmanus a=ritu
netwerk/protocol/websocket/WebSocketChannel.cpp
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -3127,19 +3127,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();