You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "serrislew (via GitHub)" <gi...@apache.org> on 2023/06/27 20:35:31 UTC

[GitHub] [trafficserver] serrislew commented on a diff in pull request #9896: Add support for async requests for wasm plugin

serrislew commented on code in PR #9896:
URL: https://github.com/apache/trafficserver/pull/9896#discussion_r1244320676


##########
plugins/experimental/wasm/wasm_main.cc:
##########
@@ -243,15 +246,25 @@ http_event_handler(TSCont contp, TSEvent event, void *data)
 
   TSMutexUnlock(old_wasm->mutex());
 
-  if (result == 0) {
-    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
-  } else if (result < 0) {
-    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_ERROR);
+  // check if we have reenable transaction already or not
+  if ((context == nullptr) || (!context->isTxnReenable())) {
+    TSDebug(WASM_DEBUG_TAG, "[%s] no context or not yet reenabled transaction", __FUNCTION__);
+
+    if (result == 0) {
+      TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);

Review Comment:
   Why does `context->reenable_txn_` not need to get set here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org