| 128 | } |
| 129 | |
| 130 | std::string |
| 131 | Url::getHost() const |
| 132 | { |
| 133 | std::string ret_str; |
| 134 | if (isInitialized()) { |
| 135 | int length; |
| 136 | const char *memptr = TSUrlHostGet(state_->hdr_buf_, state_->url_loc_, &length); |
| 137 | if (memptr && length) { |
| 138 | ret_str.assign(memptr, length); |
| 139 | } |
| 140 | LOG_DEBUG("Using host [%s]", ret_str.c_str()); |
| 141 | } |
| 142 | return ret_str; |
| 143 | } |
| 144 | |
| 145 | uint16_t |
| 146 | Url::getPort() const |
no test coverage detected