static int ts_lua_http_resp_transform_get_upstream_bytes(lua_State *L) { ts_lua_http_transform_ctx *transform_ctx; transform_ctx = ts_lua_get_http_transform_ctx(L); lua_pushnumber(L, transform_ctx->upstream_bytes); return 1; }
static int ts_lua_http_resp_transform_set_downstream_bytes(lua_State *L) { int64_t n; ts_lua_http_transform_ctx *transform_ctx; transform_ctx = ts_lua_get_http_transform_ctx(L); n = luaL_checkinteger(L, 1); transform_ctx->downstream_bytes = n; return 0; }
static int ts_lua_http_resp_transform_get_upstream_bytes(lua_State *L) { ts_lua_http_transform_ctx *transform_ctx; transform_ctx = ts_lua_get_http_transform_ctx(L); if (transform_ctx == NULL) { TSError("[ts_lua] missing transform_ctx"); return 0; } lua_pushnumber(L, transform_ctx->upstream_bytes); return 1; }
static int ts_lua_http_resp_transform_set_downstream_bytes(lua_State *L) { int64_t n; ts_lua_http_transform_ctx *transform_ctx; transform_ctx = ts_lua_get_http_transform_ctx(L); if (transform_ctx == NULL) { TSError("[ts_lua] missing transform_ctx"); return 0; } n = luaL_checkinteger(L, 1); transform_ctx->downstream_bytes = n; return 0; }