Sfoglia il codice sorgente

topos: reused stored branch attributes in case of retransmission

(cherry picked from commit a4043c445b0673ca8f5ff7819caf9ac156da1e73)
Daniel-Constantin Mierla 9 anni fa
parent
commit
acb67a89ce
1 ha cambiato i file con 7 aggiunte e 3 eliminazioni
  1. 7 3
      modules/topos/tps_msg.c

+ 7 - 3
modules/topos/tps_msg.c

@@ -644,8 +644,12 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int local)
 
 	tps_storage_lock_get(&lkey);
 	if(dialog==0) {
-		if(tps_storage_record(msg, ptsd)<0) {
-			goto error;
+		if(tps_storage_load_branch(msg, &mtsd, &stsd)!=0) {
+			if(tps_storage_record(msg, ptsd)<0) {
+				goto error;
+			}
+		} else {
+			ptsd = &stsd;
 		}
 	}
 
@@ -667,7 +671,7 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int local)
 	tps_remove_headers(msg, HDR_CONTACT_T);
 	tps_remove_headers(msg, HDR_VIA_T);
 
-	tps_reinsert_via(msg, ptsd, &ptsd->x_via1);
+	tps_reinsert_via(msg, &mtsd, &mtsd.x_via1);
 	if(direction==TPS_DIR_UPSTREAM) {
 		tps_reinsert_contact(msg, ptsd, &ptsd->as_contact);
 	} else {