[ https://issues.apache.org/jira/browse/TS-4990?focusedWorklogId=31164&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31164 ]
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_r85234954 --- Diff: plugins/experimental/ts_lua/ts_lua_http.c --- @@ -526,6 +596,69 @@ ts_lua_http_resp_cache_untransformed(lua_State *L) } static int +ts_lua_http_get_client_protocol_stack(lua_State *L) +{ + char const *results[10]; + int count = 0; + ts_lua_http_ctx *http_ctx; + + GET_HTTP_CONTEXT(http_ctx, L); + + TSHttpTxnClientProtocolStackGet(http_ctx->txnp, 10, results, &count); + for (int i = 0; i < count; i++) { + lua_pushstring(L, results[i]); + } + + return count; +} + +static int +ts_lua_http_server_push(lua_State *L) +{ + const char *url; + const char *push_url; + size_t url_len; + ts_lua_http_ctx *http_ctx; + + GET_HTTP_CONTEXT(http_ctx, L); + + url = luaL_checklstring(L, 1, &url_len); + push_url = TSstrndup(url, url_len); + TSHttpTxnServerPush(http_ctx->txnp, push_url, url_len); + + return 0; +} + +static int +ts_lua_http_is_websocket(lua_State *L) +{ + ts_lua_http_ctx *http_ctx; + + GET_HTTP_CONTEXT(http_ctx, L); + + if (TSHttpTxnIsWebsocket(http_ctx->txnp)) { --- End diff -- Consider: ```C lua_pushboolean(L, TSHttpTxnIsWebsocket(http_ctx->txnp)); ``` Issue Time Tracking ------------------- Worklog Id: (was: 31164) Time Spent: 1h (was: 50m) > 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: 1h > 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)