| 135 | } |
| 136 | |
| 137 | inline void |
| 138 | HttpUserAgent::set_txn(ProxyTransaction *txn, TransactionMilestones &milestones) |
| 139 | { |
| 140 | m_txn = txn; |
| 141 | |
| 142 | // It seems to be possible that the m_txn pointer will go stale before log |
| 143 | // entries for this HTTP transaction are generated. Therefore, collect |
| 144 | // information that may be needed for logging. |
| 145 | this->save_transaction_info(); |
| 146 | if (auto p{txn->get_proxy_ssn()}; p) { |
| 147 | m_client_connection_id = p->connection_id(); |
| 148 | } |
| 149 | |
| 150 | m_conn_info.tcp_reused = !txn->is_first_transaction(); |
| 151 | |
| 152 | auto netvc{txn->get_netvc()}; |
| 153 | |
| 154 | if (auto tbs = netvc->get_service<TLSBasicSupport>()) { |
| 155 | m_conn_info.connection_is_ssl = true; |
| 156 | if (auto sec_protocol{tbs->get_tls_protocol_name()}; sec_protocol) { |
| 157 | m_conn_info.sec_protocol = sec_protocol; |
| 158 | } else { |
| 159 | m_conn_info.sec_protocol = "-"; |
| 160 | } |
| 161 | if (auto cipher{tbs->get_tls_cipher_suite()}; cipher) { |
| 162 | m_conn_info.cipher_suite = cipher; |
| 163 | } else { |
| 164 | m_conn_info.cipher_suite = "-"; |
| 165 | } |
| 166 | if (auto curve{tbs->get_tls_curve()}; curve) { |
| 167 | m_conn_info.curve = curve; |
| 168 | } else { |
| 169 | m_conn_info.curve = "-"; |
| 170 | } |
| 171 | |
| 172 | if (auto group{tbs->get_tls_group()}; group) { |
| 173 | m_conn_info.security_group = group; |
| 174 | } else { |
| 175 | m_conn_info.security_group = "-"; |
| 176 | } |
| 177 | |
| 178 | if (!m_conn_info.tcp_reused) { |
| 179 | // Copy along the TLS handshake timings |
| 180 | milestones[TS_MILESTONE_TLS_HANDSHAKE_START] = tbs->get_tls_handshake_begin_time(); |
| 181 | milestones[TS_MILESTONE_TLS_HANDSHAKE_END] = tbs->get_tls_handshake_end_time(); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | if (auto as = netvc->get_service<ALPNSupport>()) { |
| 186 | m_conn_info.alpn_id = as->get_negotiated_protocol_id(); |
| 187 | } |
| 188 | |
| 189 | if (auto tsrs = netvc->get_service<TLSSessionResumptionSupport>()) { |
| 190 | m_conn_info.ssl_reused = tsrs->getSSLSessionCacheHit(); |
| 191 | } |
| 192 | |
| 193 | if (auto protocol_str{txn->get_protocol_string()}; protocol_str) { |
| 194 | m_conn_info.protocol = protocol_str; |
no test coverage detected