| 48 | } |
| 49 | |
| 50 | void |
| 51 | detail::ConnBase::TcpInfo::initialize() |
| 52 | { |
| 53 | #if defined(TCP_INFO) && defined(HAVE_STRUCT_TCP_INFO) |
| 54 | _ensure_initialized(_owner); |
| 55 | if (!_ready) { |
| 56 | int connfd = _owner->FD(); |
| 57 | |
| 58 | TSAssert(_owner->_state->txnp); |
| 59 | if (connfd < 0 || TSHttpTxnIsInternal(_owner->_state->txnp)) { // No TCPInfo for internal transactions |
| 60 | _ready = false; |
| 61 | // ToDo: Deal with errors? |
| 62 | } else { |
| 63 | if (getsockopt(connfd, IPPROTO_TCP, TCP_INFO, &info, &info_len) == 0) { |
| 64 | _ready = (info_len > 0); |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | #endif |
| 69 | } |
| 70 | |
| 71 | cripts::string_view |
| 72 | detail::ConnBase::TcpInfo::Log() |
nothing calls this directly
no test coverage detected