Browse code

Merge pull request #1063 from grumvalski/t_continue_crash

tm: don't reset uac reply if in a continue route

Daniel-Constantin Mierla authored on 18/04/2017 16:48:01 • GitHub committed on 18/04/2017 16:48:01
Showing 1 changed files
... ...
@@ -1279,7 +1279,10 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
1279 1279
 			picked_branch = branch;
1280 1280
 			run_branch_failure_handlers( Trans, Trans->uac[branch].reply,
1281 1281
 									new_code, extra_flags);
1282
-			Trans->uac[branch].reply = 0;
1282
+		 	/* Don't do reset the reply if we are in a resume route, 
1283
+		  	 * we need to free it at the end of the continue processing */
1284
+			if (!(Trans->flags&T_ASYNC_CONTINUE))
1285
+				Trans->uac[branch].reply = 0;
1283 1286
 		}
1284 1287
 
1285 1288
 
... ...
@@ -1362,8 +1365,11 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
1362 1365
 
1363 1366
 		/* now reset it; after the failure logic, the reply may
1364 1367
 		 * not be stored any more and we don't want to keep into
1365
-		 * transaction some broken reference */
1366
-		Trans->uac[branch].reply = 0;
1368
+		 * transaction some broken reference. Don't do it if we                     
1369
+		 * are in a resume route, we need to free it at the end 
1370
+		 * of the continue processing */
1371
+		if (!(Trans->flags&T_ASYNC_CONTINUE))
1372
+			Trans->uac[branch].reply = 0;
1367 1373
 
1368 1374
 		/* look if the callback perhaps replied transaction; it also
1369 1375
 		 * covers the case in which a transaction is replied localy