Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1127#discussion_r85234779
  
    --- Diff: plugins/experimental/ts_lua/ts_lua_http.c ---
    @@ -387,6 +411,52 @@ ts_lua_http_set_cache_lookup_url(lua_State *L)
     }
     
     static int
    +ts_lua_http_get_parent_proxy(lua_State *L)
    +{
    +  const char *hostname = NULL;
    +  int port             = 0;
    +  ts_lua_http_ctx *http_ctx;
    +
    +  GET_HTTP_CONTEXT(http_ctx, L);
    +
    +  TSHttpTxnParentProxyGet(http_ctx->txnp, &hostname, &port);
    +
    +  if (hostname == NULL) {
    +    lua_pushnil(L);
    +  } else {
    +    lua_pushstring(L, hostname);
    +  }
    +  lua_pushnumber(L, port);
    +
    +  return 2;
    +}
    +
    +static int
    +ts_lua_http_set_parent_proxy(lua_State *L)
    +{
    +  int n = 0;
    +  const char *hostname;
    +  size_t hostname_len;
    +  int port = 0;
    +  const char *target;
    +
    +  ts_lua_http_ctx *http_ctx;
    +
    +  GET_HTTP_CONTEXT(http_ctx, L);
    +
    +  n = lua_gettop(L);
    +
    +  if (n == 2) {
    --- End diff --
    
    Throw an error if `n != 2`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to