}
get_http_auth_buff = calloc(1, global.tune.bufsize);
- static_table_key = calloc(1, sizeof(*static_table_key));
fdinfo = calloc(1, sizeof(struct fdinfo) * (global.maxsock));
fdtab = calloc(1, sizeof(struct fdtab) * (global.maxsock));
free(fdinfo); fdinfo = NULL;
free(fdtab); fdtab = NULL;
free(oldpids); oldpids = NULL;
- free(static_table_key); static_table_key = NULL;
free(get_http_auth_buff); get_http_auth_buff = NULL;
free(global_listener_queue_task); global_listener_queue_task = NULL;
#include <proto/tcp_rules.h>
/* structure used to return a table key built from a sample */
-struct stktable_key *static_table_key;
+static struct stktable_key static_table_key;
/*
* Free an allocated sticky session <ts>, and decrease sticky sessions counter
switch (t->type) {
case SMP_T_IPV4:
- static_table_key->key = &smp->data.u.ipv4;
- static_table_key->key_len = 4;
+ static_table_key.key = &smp->data.u.ipv4;
+ static_table_key.key_len = 4;
break;
case SMP_T_IPV6:
- static_table_key->key = &smp->data.u.ipv6;
- static_table_key->key_len = 16;
+ static_table_key.key = &smp->data.u.ipv6;
+ static_table_key.key_len = 16;
break;
case SMP_T_SINT:
* signed 64 it, so we can convert it inplace.
*/
*(unsigned int *)&smp->data.u.sint = (unsigned int)smp->data.u.sint;
- static_table_key->key = &smp->data.u.sint;
- static_table_key->key_len = 4;
+ static_table_key.key = &smp->data.u.sint;
+ static_table_key.key_len = 4;
break;
case SMP_T_STR:
if (!smp_make_safe(smp))
return NULL;
- static_table_key->key = smp->data.u.str.str;
- static_table_key->key_len = smp->data.u.str.len;
+ static_table_key.key = smp->data.u.str.str;
+ static_table_key.key_len = smp->data.u.str.len;
break;
case SMP_T_BIN:
t->key_size - smp->data.u.str.len);
smp->data.u.str.len = t->key_size;
}
- static_table_key->key = smp->data.u.str.str;
- static_table_key->key_len = smp->data.u.str.len;
+ static_table_key.key = smp->data.u.str.str;
+ static_table_key.key_len = smp->data.u.str.len;
break;
default: /* impossible case. */
return NULL;
}
- return static_table_key;
+ return &static_table_key;
}
/*
switch (px->table.type) {
case SMP_T_IPV4:
uint32_key = htonl(inetaddr_host(args[4]));
- static_table_key->key = &uint32_key;
+ static_table_key.key = &uint32_key;
break;
case SMP_T_IPV6:
inet_pton(AF_INET6, args[4], ip6_key);
- static_table_key->key = &ip6_key;
+ static_table_key.key = &ip6_key;
break;
case SMP_T_SINT:
{
return 1;
}
uint32_key = (uint32_t) val;
- static_table_key->key = &uint32_key;
+ static_table_key.key = &uint32_key;
break;
}
break;
case SMP_T_STR:
- static_table_key->key = args[4];
- static_table_key->key_len = strlen(args[4]);
+ static_table_key.key = args[4];
+ static_table_key.key_len = strlen(args[4]);
break;
default:
switch (appctx->ctx.table.action) {
if (!cli_has_level(appctx, ACCESS_LVL_OPER))
return 1;
- ts = stktable_lookup_key(&px->table, static_table_key);
+ ts = stktable_lookup_key(&px->table, &static_table_key);
switch (appctx->ctx.table.action) {
case STK_CLI_ACT_SHOW:
if (ts)
stktable_touch(&px->table, ts, 1);
else {
- ts = stksess_new(&px->table, static_table_key);
+ ts = stksess_new(&px->table, &static_table_key);
if (!ts) {
/* don't delete an entry which is currently referenced */
appctx->ctx.cli.msg = "Unable to allocate a new entry\n";