[ 
https://issues.apache.org/jira/browse/TS-4627?focusedWorklogId=25616&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25616
 ]

ASF GitHub Bot logged work on TS-4627:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Jul/16 06:14
            Start Date: 18/Jul/16 06:14
    Worklog Time Spent: 10m 
      Work Description: Github user jpeach commented on a diff in the pull 
request:

    https://github.com/apache/trafficserver/pull/779#discussion_r71103039
  
    --- Diff: plugins/experimental/ts_lua/ts_lua.c ---
    @@ -140,13 +141,15 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, 
TSRemapRequestInfo *rri)
     
       http_ctx = ts_lua_create_http_ctx(main_ctx, instance_conf);
     
    -  http_ctx->txnp                = rh;
    -  http_ctx->client_request_bufp = rri->requestBufp;
    -  http_ctx->client_request_hdrp = rri->requestHdrp;
    -  http_ctx->client_request_url  = rri->requestUrl;
    -  http_ctx->rri                 = rri;
    -  http_ctx->remap               = 1;
    -  http_ctx->has_hook            = 0;
    +  http_ctx->txnp     = rh;
    +  http_ctx->has_hook = 0;
    +  http_ctx->remap    = remap;
    --- End diff --
    
    It looks like you don't really need the ``remap`` variable in the context; 
is it enough to have a non-NULL rri?


Issue Time Tracking
-------------------

    Worklog Id:     (was: 25616)
    Time Spent: 50m  (was: 40m)

> ts_lua plugin - support TSRemapOSResponse() related functionality
> -----------------------------------------------------------------
>
>                 Key: TS-4627
>                 URL: https://issues.apache.org/jira/browse/TS-4627
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Lua, Plugins
>            Reporter: Kit Chan
>            Assignee: Kit Chan
>             Fix For: 7.0.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> I want to add enhancement to ts_lua so I can write script to take advantage 
> of the TSRemapOSResponse() related functionality.
> here is one such example
> {code}
> function do_os_response()
>     ts.debug('do_os_response')
>     ts.http.enable_redirect(0)
>     local st = ts.http.get_server_state()
>     if st == TS_LUA_SRVSTATE_CONNECTION_ALIVE then
>       ts.debug('alive')
>       ts.http.enable_redirect(0)
>     else
>       ts.debug('not alive')
>       ts.http.redirect_url_set('http://www.cnn.com')
>       ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
>     end
> end
> function send_response()
>     ts.debug('send_response')
> end
> {code}
> Basically it would allow me to do something when origin server fails to 
> connect (such as DNS error, timeout, etc)



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

Reply via email to