Skip to content

Commit 9ee127a

Browse files
Auto route correct
1 parent 072e522 commit 9ee127a

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

modules/topology_hiding/th_no_dlg_logic.c

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -448,42 +448,40 @@ static void th_no_dlg_onreply(struct cell *t, int type, struct tmcb_params *para
448448
}
449449
}
450450

451-
if (one_way_hiding) {
452-
if (!is_sequential) {
453-
if (auto_route_on_trusted_socket) {
454-
rr_lmp = th_no_dlg_add_auto_record_route(rpl, flags);
455-
if (rr_lmp == NULL) {
456-
LM_ERR("Failed to add Record-Route header\n");
457-
pkg_free(suffix);
458-
return;
459-
}
460-
}
451+
if (one_way_hiding && !is_sequential) {
452+
if (auto_route_on_trusted_socket) {
453+
rr_lmp = th_no_dlg_add_auto_record_route(rpl, flags);
454+
if (rr_lmp == NULL) {
455+
LM_ERR("Failed to add Record-Route header\n");
456+
pkg_free(suffix);
457+
return;
458+
}
459+
}
461460

462-
if (rr_lmp == NULL) {
463-
rr_lmp = anchor_lump(rpl, rpl->headers->name.s - rpl->buf, HDR_RECORDROUTE_T);
464-
}
461+
if (rr_lmp == NULL) {
462+
rr_lmp = anchor_lump(rpl, rpl->headers->name.s - rpl->buf, HDR_RECORDROUTE_T);
463+
}
465464

466-
if ((req_rr_count = list_rr_body(req->record_route, &additional_rrs)) < 0 ){
467-
LM_ERR("failed to print route records \n");
468-
return;
469-
}
465+
if ((req_rr_count = list_rr_body(req->record_route, &additional_rrs)) < 0 ){
466+
LM_ERR("failed to print route records \n");
467+
return;
468+
}
470469

471-
for (int i = 0; i < req_rr_count; i++) {
472-
BUILD_RR_HEADER_BUFFER(req_rr_buf, req_rr_buf_len, additional_rrs[i]);
470+
for (int i = 0; i < req_rr_count; i++) {
471+
BUILD_RR_HEADER_BUFFER(req_rr_buf, req_rr_buf_len, additional_rrs[i]);
473472

474-
if (!req_rr_buf) {
475-
LM_ERR("no more pkg memory\n");
476-
return;
477-
}
473+
if (!req_rr_buf) {
474+
LM_ERR("no more pkg memory\n");
475+
return;
476+
}
478477

479-
if (!(rr_lmp = insert_new_lump_after(rr_lmp, req_rr_buf, req_rr_buf_len, 0))) {
480-
LM_ERR("failed to insert prefix\n");
481-
pkg_free(req_rr_buf);
482-
return;
483-
}
478+
if (!(rr_lmp = insert_new_lump_after(rr_lmp, req_rr_buf, req_rr_buf_len, 0))) {
479+
LM_ERR("failed to insert prefix\n");
480+
pkg_free(req_rr_buf);
481+
return;
484482
}
485-
}
486-
}
483+
}
484+
}
487485

488486
if (!one_way_hiding && !(rpl->REPLY_STATUS >= 300 && rpl->REPLY_STATUS < 400)) {
489487
if (th_no_dlg_encode_contact(rpl, flags, route_s, rr_count_to_skip_encode, username) < 0) {

0 commit comments

Comments
 (0)