bug 1413258 - Collect SSL Telemetry on all channels r?mcmanus draft
authorChris H-C <chutten@mozilla.com>
Fri, 03 Nov 2017 15:06:59 -0400
changeset 692987 6773aa01e1bd49f62bf329dc3a212384133672ff
parent 692227 3502694e2053f9d8a730f8b8ea1c2e783e58dba3
child 738900 3638c0957352a820f3f801963baf07e1189aee1b
push id87655
push userbmo:chutten@mozilla.com
push dateFri, 03 Nov 2017 19:10:49 +0000
reviewersmcmanus
bugs1413258, 1340021
milestone58.0a1
bug 1413258 - Collect SSL Telemetry on all channels r?mcmanus Ever since bug 1340021 we were supposed to be collecting *_IS_SSL probes on release, but the code in nsHttpChannel prevented it from happening. MozReview-Commit-ID: IdU4Gppos6E
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2259,27 +2259,26 @@ nsHttpChannel::ProcessAltService()
 nsresult
 nsHttpChannel::ProcessResponse()
 {
     uint32_t httpStatus = mResponseHead->Status();
 
     LOG(("nsHttpChannel::ProcessResponse [this=%p httpStatus=%u]\n",
         this, httpStatus));
 
-    // do some telemetry
-    if (gHttpHandler->IsTelemetryEnabled()) {
-        // Gather data on whether the transaction and page (if this is
-        // the initial page load) is being loaded with SSL.
-        Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_IS_SSL,
+    // Gather data on whether the transaction and page (if this is
+    // the initial page load) is being loaded with SSL.
+    Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_IS_SSL,
+                          mConnectionInfo->EndToEndSSL());
+    if (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI) {
+        Telemetry::Accumulate(Telemetry::HTTP_PAGELOAD_IS_SSL,
                               mConnectionInfo->EndToEndSSL());
-        if (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI) {
-            Telemetry::Accumulate(Telemetry::HTTP_PAGELOAD_IS_SSL,
-                                  mConnectionInfo->EndToEndSSL());
-        }
-
+    }
+
+    if (gHttpHandler->IsTelemetryEnabled()) {
         // how often do we see something like Alt-Svc: "443:quic,p=1"
         nsAutoCString alt_service;
         Unused << mResponseHead->GetHeader(nsHttp::Alternate_Service, alt_service);
         bool saw_quic = (!alt_service.IsEmpty() &&
                          PL_strstr(alt_service.get(), "quic")) ? 1 : 0;
         Telemetry::Accumulate(Telemetry::HTTP_SAW_QUIC_ALT_PROTOCOL, saw_quic);
 
         // Gather data on how many URLS get redirected