> On Aug 6, 2018, at 3:14 PM, Leif Hedstrom <zw...@apache.org> wrote:
>
> We have this API:
>
> void TSHttpTxnSetHttpRetStatus(TSHttpTxn txnp, TSHttpStatus
> http_retstatus);
>
>
> Which on its own is a little strange, but looking at code, and talking to
> Alan, I believe this was added when we added remap plugins long ago, to allow
> such plugins to modify status codes without having an HttpHdr response.
>
> So, I guess that is fine, and we use it fairly frequently, but looking at
> this, the naming is really non-standard. I’d like to propose that we change
> this API to
>
> void TSHttpTxnStatusSet(TSHttpTxn txnp, TSHttpStatus status);
>
>
>
> This seems much more inline with the other StatusSet that we have,
> TSHttpHdrStatusSet().
>
>
> If this is reasonable, I’d also like to add a TSHttpTxnStatusGet(TSHttpTxn
> txnp) call.
>
>
> In addition, I’m contemplating adding two new APIs, on the same note:
>
> void TSHttpTxnStatusSet(TSHttpTxn txnp, const char* reason);
> const char* TSHttpTxnStatusGet(TSHttpTxn txnp);
Sigh, the last two should be
void TSHttpTxnReasonSet(TSHttpTxn txnp, const char* reason);
const char* TSHttpTxnReasonGet(TSHttpTxn txnp);
The point being, I might want to set the transaction return code to a 403 in a
remap plugin, but there’s no way to set a custom reason phrase right now.
Cheers,
— leif