[
https://issues.apache.org/jira/browse/TS-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14584131#comment-14584131
]
Sudheer Vinukonda commented on TS-3148:
---------------------------------------
Is there a way to reproduce the problem? I am not sure how to force a plugin to
fail initialization. Reenabling with *TS_EVENT_HTTP_ERROR* does seem to return
an error as expected.
An example I tried:
{code}
case TS_EVENT_HTTP_TXN_START:
{
char* tmp = (char*)TSmalloc(256);
size_t len = snprintf(tmp, 255,
"This is very small example of TS API
usage!\nIteration %d!\nHTTP return code %d\n",
0, TS_HTTP_STATUS_CONTINUE);
TSHttpTxnErrorBodySet((TSHttpTxn) txnp, tmp, len, NULL); // Defaults to
text/html
//TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
TSHttpTxnReenable(txnp, TS_EVENT_HTTP_ERROR);
return 0;
}
{code}
> TS shows HTTP/0.9 behaviour when a request is aborted early
> -----------------------------------------------------------
>
> Key: TS-3148
> URL: https://issues.apache.org/jira/browse/TS-3148
> Project: Traffic Server
> Issue Type: Bug
> Components: HTTP, TS API
> Reporter: Nick Kew
> Assignee: Sudheer Vinukonda
> Fix For: 6.0.0
>
>
> When a plugin fails per-txn initialisation in a TXN_START function, it should
> be able to return a 500 (Internal Server Error) response.
> Instead, TS returns an HTTP 0.9 response: no response code or headers! A
> TSHttpTxnErrorBodySet is honoured and works correctly, but setting Response
> code, Reason, and Headers are silently ignored.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)