- if (TID_RESPONSE != tr_msg_get_msg_type(resp_msg)) {
- fprintf(stderr, "tidc_fwd_request: Error, no response in the response!\n");
- return -1;
+ tid_resp = tr_msg_get_resp(resp_msg);
+ if (tid_resp == NULL) {
+ tr_err( "tidc_fwd_request: Error, no response in the response!\n");
+ goto error;
+ }
+
+ /* 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);