This routine can be called by tests, from the READ_RESPONSE_HDR_HOOK to figure out the id of a test message Returns id/-1 in case of error
| 495 | // to figure out the id of a test message |
| 496 | // Returns id/-1 in case of error |
| 497 | static int |
| 498 | get_response_id(TSHttpTxn txnp) |
| 499 | { |
| 500 | TSMBuffer bufp; |
| 501 | TSMLoc hdr_loc; |
| 502 | int id = -1; |
| 503 | |
| 504 | if (TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) { |
| 505 | return -1; |
| 506 | } |
| 507 | |
| 508 | id = get_request_id_value(X_RESPONSE_ID, bufp, hdr_loc); |
| 509 | TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc); |
| 510 | return id; |
| 511 | } |
| 512 | |
| 513 | ////////////////////////////////////////////////////////////////////////////// |
| 514 | // SOCKET CLIENT |
no test coverage detected