| 64 | } |
| 65 | |
| 66 | std::string |
| 67 | Url::getUrlString() const |
| 68 | { |
| 69 | std::string ret_str; |
| 70 | if (isInitialized()) { |
| 71 | int length; |
| 72 | char *memptr = TSUrlStringGet(state_->hdr_buf_, state_->url_loc_, &length); |
| 73 | if (memptr && length) { |
| 74 | ret_str.assign(memptr, length); |
| 75 | TSfree(memptr); |
| 76 | LOG_DEBUG("Got URL [%s]", ret_str.c_str()); |
| 77 | } else { |
| 78 | LOG_ERROR("Got null/zero-length URL string; hdr_buf %p, url_loc %p, ptr %p, length %d", state_->hdr_buf_, state_->url_loc_, |
| 79 | memptr, length); |
| 80 | } |
| 81 | } |
| 82 | return ret_str; |
| 83 | } |
| 84 | |
| 85 | std::string |
| 86 | Url::getPath() const |
no test coverage detected