[ 
https://issues.apache.org/jira/browse/TS-4675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15382578#comment-15382578
 ] 

Leif Hedstrom commented on TS-4675:
-----------------------------------

To add on to [~mlibbey]'s comments:

1. Yes, REMAP_PSEUDO_HOOK is similar to READ_REQUEST_HDR_HOOK. Basically, in 
the REMAP_PSEUDO_HOOK, which is only available when used as a remap plugin, the 
rule gets executed as part of the remap evaluation. This is not a real hook in 
the normal sense, but it happens after read-request-hdr-hook, but before 
send-request-her-hook. It has to be this way, because "remap" is not a hook, it 
just gets called synchronously, so using the pseudo-hook lets you pretend you 
are in a hook.

2. That define is a backwards compatible thing (maybe time to remove it for 
7.0.0). The hook is now named TS_HTTP_PRE_REMAP_HOOK, but I think we might not 
want to change the hook string name in header_rewrite ? Regardless, I'm pretty 
sure that Miles is right, and READ_RESPONSE_HDR_HOOK and 
READ_REQUEST_PRE_REMAP_HOOK are basically the same.

3. We should perhaps point out which hooks are not available as part of running 
as a remap plugin (i.e. any hook prior to remap are not available, since we 
can't really go back in time and redo hooks).


> header_rewrite hook descriptions are wrong
> ------------------------------------------
>
>                 Key: TS-4675
>                 URL: https://issues.apache.org/jira/browse/TS-4675
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Miles Libbey
>            Assignee: Leif Hedstrom
>             Fix For: Docs
>
>
> - REMAP_PSEUDO_HOOK is not similar to READ_RESPONSE_HDR_HOOK. 
> - Think that READ_RESPONSE_HDR_HOOK and READ_REQUEST_PRE_REMAP_HOOK are 
> aliases to each other.  
> ( #define TS_HTTP_READ_REQUEST_PRE_REMAP_HOOK TS_HTTP_PRE_REMAP_HOOK /* 
> backwards compat */)
> - Should note that READ_REQUEST_PRE_REMAP_HOOK/READ_REQUEST_HDR_HOOK can not 
> be applied to remap rules. Just global rules.
> - REMAP_PSEUDO_HOOK doesn't show in 
> https://docs.trafficserver.apache.org/en/latest/developer-guide/plugins/hooks-and-transactions/index.en.html#http-transaction-state-diagram
>  , so don't know when it actually fires.
> - We should present the hooks in order of their firing. Eg, 
> READ_RESPONSE_HDR_HOOK should be after pre_remap...
> - Seems like we should have a diagram similar to 
> https://docs.trafficserver.apache.org/en/latest/developer-guide/plugins/hooks-and-transactions/index.en.html#http-transaction-state-diagram
>  on the page. (With the header_rewrite names, and simplified -- don't need 
> all the gory oval detail.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to