[
https://issues.apache.org/jira/browse/TS-4135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15116435#comment-15116435
]
Sandeep Davu commented on TS-4135:
----------------------------------
[~briang] Here is a simple redirect implementation that will lead to coredump.
{code:title=ClientRedirect.cc|borderStyle=solid}
class ClientRedirectTransactionPlugin : public atscppapi::TransactionPlugin {
public:
ClientRedirectTransactionPlugin(Transaction &transaction, const string
&location)
: TransactionPlugin(transaction), location_(location) {
TransactionPlugin::registerHook(HOOK_SEND_RESPONSE_HEADERS);
transaction.resume();
}
void handleSendResponseHeaders(Transaction &transaction) {
transaction.redirectTo("http://test.com/");
transaction.resume();
}
virtual ~ClientRedirectTransactionPlugin() { }
};
{code}
> C++ api coredumps when used with other plugins using TSHttpTxnRedirectUrlSet.
> -----------------------------------------------------------------------------
>
> Key: TS-4135
> URL: https://issues.apache.org/jira/browse/TS-4135
> Project: Traffic Server
> Issue Type: Bug
> Components: CPP API
> Reporter: Sandeep Davu
> Assignee: Brian Geffon
> Labels: crash
> Fix For: 6.2.0
>
>
> There are multiple TS_EVENT_HTTP_SEND_REQUEST_HDR and
> TS_EVENT_HTTP_READ_RESPONSE_HDR for plugins that use TSHttpTxnRedirectUrlSet.
> Transaction object ignores these events.
> Ideally these events should be handled by reinitializing the server_request
> and server_response.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)