Prechádzať zdrojové kódy

tm: release transaction on kill if a final response was sent

- do not send another final response for error cases
Daniel-Constantin Mierla 1 rok pred
rodič
commit
33b2e513ae
1 zmenil súbory, kde vykonal 10 pridanie a 0 odobranie
  1. 10 0
      src/modules/tm/t_funcs.c

+ 10 - 0
src/modules/tm/t_funcs.c

@@ -177,6 +177,11 @@ int kill_transaction(struct cell *trans, int error)
 	int reply_ret;
 	int ret;
 
+	if((trans->uas.request != NULL)
+			&& (trans->uas.request->msg_flags & FL_FINAL_REPLY)) {
+		return t_release_transaction(trans);
+	}
+
 	/*  we reply statefully and enter WAIT state since error might
 		have occurred in middle of forking and we do not
 		want to put the forking burden on upstream client;
@@ -205,6 +210,11 @@ int kill_transaction_unsafe(struct cell *trans, int error)
 	int reply_ret;
 	int ret;
 
+	if((trans->uas.request != NULL)
+			&& (trans->uas.request->msg_flags & FL_FINAL_REPLY)) {
+		return t_release_transaction(trans);
+	}
+
 	/*  we reply statefully and enter WAIT state since error might
 		have occurred in middle of forking and we do not
 		want to put the forking burden on upstream client;