[ https://issues.apache.org/jira/browse/TS-4990?focusedWorklogId=31163&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31163 ]
ASF GitHub Bot logged work on TS-4990: -------------------------------------- Author: ASF GitHub Bot Created on: 26/Oct/16 22:38 Start Date: 26/Oct/16 22:38 Worklog Time Spent: 10m Work Description: 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`? Issue Time Tracking ------------------- Worklog Id: (was: 31163) Time Spent: 50m (was: 40m) > Add support for new apis in ts_lua > ---------------------------------- > > Key: TS-4990 > URL: https://issues.apache.org/jira/browse/TS-4990 > Project: Traffic Server > Issue Type: Improvement > Components: Lua, Plugins > Reporter: Kit Chan > Assignee: Kit Chan > Fix For: 7.1.0 > > Time Spent: 50m > Remaining Estimate: 0h > > Want to add support for the following apis in ts_lua plugin > TSHttpTxnParentProxyGet > TSHttpTxnParentProxySet > TSHttpTxnClientProtocolStackGet > TSHttpTxnServerPush > TSHttpTxnIsWebsocket > TSHttpTxnPluginTagGet > TSHttpTxnServerAddrSet -- This message was sent by Atlassian JIRA (v6.3.4#6332)