summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-11 07:13:53 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-11 07:13:53 +0100
commit02a62aeabb660db7e5d777ab78bef6e07577ef0c (patch)
tree7287fa2c1bba3baa4000de994addb5d905a74326
parent7659d3a74788ee6ba84519f431703e4b0b1dbd29 (diff)
downloaduxp-02a62aeabb660db7e5d777ab78bef6e07577ef0c.tar.gz
Bug 1343600 - Add TLS handshake Start/Stop events
-rw-r--r--netwerk/base/Dashboard.cpp16
-rw-r--r--netwerk/protocol/http/nsHttpConnection.cpp12
-rw-r--r--netwerk/protocol/http/nsHttpTransaction.cpp4
-rw-r--r--xpcom/base/ErrorList.h16
4 files changed, 33 insertions, 15 deletions
diff --git a/netwerk/base/Dashboard.cpp b/netwerk/base/Dashboard.cpp
index f5d0880aed..83da7d6a4e 100644
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -892,13 +892,15 @@ typedef struct
#define ERROR(key, val) {key, #key}
ErrorEntry socketTransportStatuses[] = {
- ERROR(NS_NET_STATUS_RESOLVING_HOST, FAILURE(3)),
- ERROR(NS_NET_STATUS_RESOLVED_HOST, FAILURE(11)),
- ERROR(NS_NET_STATUS_CONNECTING_TO, FAILURE(7)),
- ERROR(NS_NET_STATUS_CONNECTED_TO, FAILURE(4)),
- ERROR(NS_NET_STATUS_SENDING_TO, FAILURE(5)),
- ERROR(NS_NET_STATUS_WAITING_FOR, FAILURE(10)),
- ERROR(NS_NET_STATUS_RECEIVING_FROM, FAILURE(6)),
+ ERROR(NS_NET_STATUS_RESOLVING_HOST, FAILURE(3)),
+ ERROR(NS_NET_STATUS_RESOLVED_HOST, FAILURE(11)),
+ ERROR(NS_NET_STATUS_CONNECTING_TO, FAILURE(7)),
+ ERROR(NS_NET_STATUS_CONNECTED_TO, FAILURE(4)),
+ ERROR(NS_NET_STATUS_TLS_HANDSHAKE_STARTING, FAILURE(12)),
+ ERROR(NS_NET_STATUS_TLS_HANDSHAKE_ENDED, FAILURE(13)),
+ ERROR(NS_NET_STATUS_SENDING_TO, FAILURE(5)),
+ ERROR(NS_NET_STATUS_WAITING_FOR, FAILURE(10)),
+ ERROR(NS_NET_STATUS_RECEIVING_FROM, FAILURE(6)),
};
#undef ERROR
diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp
index 916d1249c0..e80607d694 100644
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -313,6 +313,13 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue,
if (NS_FAILED(rv))
goto npnComplete;
+ if (!m0RTTChecked) {
+ // We reuse m0RTTChecked. We want to send this status only once.
+ mTransaction->OnTransportStatus(mSocketTransport,
+ NS_NET_STATUS_TLS_HANDSHAKE_STARTING,
+ 0);
+ }
+
rv = ssl->GetNegotiatedNPN(negotiatedNPN);
if (!m0RTTChecked && (rv == NS_ERROR_NOT_CONNECTED) &&
!mConnInfo->UsingProxy()) {
@@ -443,6 +450,11 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue,
npnComplete:
LOG(("nsHttpConnection::EnsureNPNComplete setting complete to true"));
mNPNComplete = true;
+
+ mTransaction->OnTransportStatus(mSocketTransport,
+ NS_NET_STATUS_TLS_HANDSHAKE_ENDED,
+ 0);
+
if (mWaitingFor0RTTResponse) {
mWaitingFor0RTTResponse = false;
if (NS_FAILED(mTransaction->Finish0RTT(true))) {
diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp
index 7c0c7f87d6..16e8beee21 100644
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -619,7 +619,9 @@ nsHttpTransaction::OnTransportStatus(nsITransport* transport,
} else if (status == NS_NET_STATUS_CONNECTING_TO) {
SetConnectStart(TimeStamp::Now());
} else if (status == NS_NET_STATUS_CONNECTED_TO) {
- SetConnectEnd(TimeStamp::Now());
+ SetConnectEnd(TimeStamp::Now(), true);
+ } else if (status == NS_NET_STATUS_TLS_HANDSHAKE_ENDED) {
+ SetConnectEnd(TimeStamp::Now(), false);
}
}
diff --git a/xpcom/base/ErrorList.h b/xpcom/base/ErrorList.h
index cfa461fe40..5ab4bfa297 100644
--- a/xpcom/base/ErrorList.h
+++ b/xpcom/base/ErrorList.h
@@ -327,13 +327,15 @@
ERROR(NS_NET_STATUS_WRITING, FAILURE(9)),
/* nsISocketTransport */
- ERROR(NS_NET_STATUS_RESOLVING_HOST, FAILURE(3)),
- ERROR(NS_NET_STATUS_RESOLVED_HOST, FAILURE(11)),
- ERROR(NS_NET_STATUS_CONNECTING_TO, FAILURE(7)),
- ERROR(NS_NET_STATUS_CONNECTED_TO, FAILURE(4)),
- ERROR(NS_NET_STATUS_SENDING_TO, FAILURE(5)),
- ERROR(NS_NET_STATUS_WAITING_FOR, FAILURE(10)),
- ERROR(NS_NET_STATUS_RECEIVING_FROM, FAILURE(6)),
+ ERROR(NS_NET_STATUS_RESOLVING_HOST, FAILURE(3)),
+ ERROR(NS_NET_STATUS_RESOLVED_HOST, FAILURE(11)),
+ ERROR(NS_NET_STATUS_CONNECTING_TO, FAILURE(7)),
+ ERROR(NS_NET_STATUS_CONNECTED_TO, FAILURE(4)),
+ ERROR(NS_NET_STATUS_TLS_HANDSHAKE_STARTING, FAILURE(12)),
+ ERROR(NS_NET_STATUS_TLS_HANDSHAKE_ENDED, FAILURE(13)),
+ ERROR(NS_NET_STATUS_SENDING_TO, FAILURE(5)),
+ ERROR(NS_NET_STATUS_WAITING_FOR, FAILURE(10)),
+ ERROR(NS_NET_STATUS_RECEIVING_FROM, FAILURE(6)),
/* nsIInterceptedChannel */
/* Generic error for non-specific failures during service worker interception */