shukitchan commented on a change in pull request #7233:
URL: https://github.com/apache/trafficserver/pull/7233#discussion_r500030348
##########
File path: plugins/multiplexer/ats-multiplexer.cc
##########
@@ -131,19 +145,24 @@ DoRemap(const Instance &i, TSHttpTxn t)
TSDebug(PLUGIN_TAG, "Method is %s.", std::string(method, length).c_str());
- if (length == TS_HTTP_LEN_POST && memcmp(TS_HTTP_METHOD_POST, method,
TS_HTTP_LEN_POST) == 0) {
- const TSVConn vconnection = TSTransformCreate(handlePost, t);
- assert(vconnection != nullptr);
- TSContDataSet(vconnection, new PostState(requests));
- assert(requests.empty());
- TSHttpTxnHookAdd(t, TS_HTTP_REQUEST_TRANSFORM_HOOK, vconnection);
+ if (skip_post_put && ((length == TS_HTTP_LEN_POST &&
memcmp(TS_HTTP_METHOD_POST, method, TS_HTTP_LEN_POST) == 0) ||
+ (length == TS_HTTP_LEN_PUT &&
memcmp(TS_HTTP_METHOD_PUT, method, TS_HTTP_LEN_PUT) == 0))) {
+ TSHandleMLocRelease(buffer, TS_NULL_MLOC, location);
} else {
- dispatch(requests, timeout);
- }
+ if (length == TS_HTTP_LEN_POST && memcmp(TS_HTTP_METHOD_POST, method,
TS_HTTP_LEN_POST) == 0) {
Review comment:
You only need buffer and location to extract request method.
But the "requests" and "field" variables aren't needed to be initialized
unless the request is not POST/PUT and we want to skip them
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]