| 54 | namespace ats |
| 55 | { |
| 56 | bool |
| 57 | getHeader(TSMBuffer buffer, TSMLoc location, const std::string &name, std::string &value) |
| 58 | { |
| 59 | bool result = false; |
| 60 | const TSMLoc field = TSMimeHdrFieldFind(buffer, location, name.c_str(), name.size()); |
| 61 | if (field != nullptr) { |
| 62 | int length = 0; |
| 63 | const char *const content = TSMimeHdrFieldValueStringGet(buffer, location, field, -1, &length); |
| 64 | if (content != nullptr && length > 0) { |
| 65 | value = std::string(content, length); |
| 66 | result = true; |
| 67 | } |
| 68 | TSHandleMLocRelease(buffer, location, field); |
| 69 | } |
| 70 | return result; |
| 71 | } |
| 72 | |
| 73 | namespace inliner |
| 74 | { |
no test coverage detected