+ /* Check whether the request IDs matched and warn if not. Do nothing if we don't get
+ * an ID on the return - it is not mandatory to preserve that field. */
+ if (tid_req->request_id) {
+ if ((tid_resp->request_id)
+ && (tr_name_cmp(tid_resp->request_id, tid_req->request_id) != 0)) {
+ /* Requests present but do not match */
+ tr_warning("tidc_fwd_request: Sent request ID %.*s, received response for %.*s",
+ tid_req->request_id->len, tid_req->request_id->buf,
+ tid_resp->request_id->len, tid_resp->request_id->buf);
+ }
+ } else if (tid_resp->request_id) {
+ tr_warning("tidc_fwd_request: Sent request without ID, received response for %.*s",
+ tid_resp->request_id->len, tid_resp->request_id->buf);
+ }
+
+ if (resp_handler) {
+ /* Call the caller's response function. It must copy any data it needs before returning. */
+ tr_debug("tidc_fwd_request: calling response callback function.");
+ (*resp_handler)(tidc, tid_req, tr_msg_get_resp(resp_msg), cookie);
+ }
+
+ goto cleanup;
+
+ error:
+ rc = -1;
+ cleanup: