| 185 | } |
| 186 | |
| 187 | void |
| 188 | print_response_headers(TSHttpTxn txn, std::stringstream &output) |
| 189 | { |
| 190 | TSMBuffer buf_c, buf_s; |
| 191 | TSMLoc hdr_loc; |
| 192 | if (TSHttpTxnServerRespGet(txn, &buf_s, &hdr_loc) == TS_SUCCESS) { |
| 193 | output << "{'type':'response', 'side':'server', 'headers': {\n"; |
| 194 | print_headers(buf_s, hdr_loc, output); |
| 195 | output << "\n\t}},"; |
| 196 | TSHandleMLocRelease(buf_s, TS_NULL_MLOC, hdr_loc); |
| 197 | } |
| 198 | if (TSHttpTxnClientRespGet(txn, &buf_c, &hdr_loc) == TS_SUCCESS) { |
| 199 | output << "{'type':'response', 'side':'client', 'headers': {\n"; |
| 200 | print_headers(buf_c, hdr_loc, output); |
| 201 | output << "\n\t}}"; |
| 202 | TSHandleMLocRelease(buf_c, TS_NULL_MLOC, hdr_loc); |
| 203 | } |
| 204 | } |
no test coverage detected