Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plugins/experimental/remap_stats/remap_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ stat_add(char *name, TSMgmtInt amount, TSStatPersistence persist_type, TSMutex c
static __thread bool hash_init = false;

if (unlikely(!hash_init)) {
// NOLINTNEXTLINE
hcreate_r(TS_MAX_API_STATS << 1, &stat_cache);
hash_init = true;
TSDebug(DEBUG_TAG, "stat cache hash init");
}

search.key = name;
search.data = 0;
// NOLINTNEXTLINE
hsearch_r(search, FIND, &result, &stat_cache);

if (unlikely(result == NULL)) {
Expand All @@ -78,6 +80,7 @@ stat_add(char *name, TSMgmtInt amount, TSStatPersistence persist_type, TSMutex c
if (stat_id >= 0) {
search.key = TSstrdup(name);
search.data = (void *)((intptr_t)stat_id);
// NOLINTNEXTLINE
hsearch_r(search, ENTER, &result, &stat_cache);
TSDebug(DEBUG_TAG, "Cached stat_name: %s stat_id: %d", name, stat_id);
}
Expand Down
1 change: 1 addition & 0 deletions plugins/lua/ts_lua_client_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ ts_lua_client_request_set_url_port(lua_State *L)

GET_HTTP_CONTEXT(http_ctx, L);

// NOLINTNEXTLINE
port = luaL_checkint(L, 1);

TSUrlPortSet(http_ctx->client_request_bufp, http_ctx->client_request_url, port);
Expand Down
1 change: 1 addition & 0 deletions plugins/lua/ts_lua_client_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ ts_lua_client_response_set_status(lua_State *L)

TS_LUA_CHECK_CLIENT_RESPONSE_HDR(http_ctx);

// NOLINTNEXTLINE
status = luaL_checkint(L, 1);

reason = TSHttpHdrReasonLookup(status);
Expand Down
1 change: 1 addition & 0 deletions plugins/lua/ts_lua_server_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ ts_lua_server_response_set_status(lua_State *L)

TS_LUA_CHECK_SERVER_RESPONSE_HDR(http_ctx);

// NOLINTNEXTLINE
status = luaL_checkint(L, 1);

reason = TSHttpHdrReasonLookup(status);
Expand Down