MINOR: ssl: change visibility of ssl_stats_module

In order to add stats from other files, the ssl_stats_module need to be
visible from other files.

This moves the ssl_counters definition in ssl_sock-t.h and removes the
static of ssl_stats_module.
This commit is contained in:
William Lallemand 2024-12-23 10:58:56 +01:00
parent 29b6d8af16
commit 0e6af97233
3 changed files with 9 additions and 6 deletions

View File

@ -327,5 +327,11 @@ extern const char *SSL_SOCK_KEYTYPE_NAMES[];
extern struct pool_head *ssl_sock_client_sni_pool;
struct ssl_counters {
long long sess;
long long reused_sess;
long long failed_handshake;
};
#endif /* USE_OPENSSL */
#endif /* _HAPROXY_SSL_SOCK_T_H */

View File

@ -54,6 +54,7 @@ extern int ssl_client_sni_index;
extern struct pool_head *pool_head_ssl_keylog;
extern struct pool_head *pool_head_ssl_keylog_str;
extern struct list openssl_providers;
extern struct stats_module ssl_stats_module;
int ssl_sock_prep_ctx_and_inst(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_conf,
SSL_CTX *ctx, struct ckch_inst *ckch_inst, char **err);

View File

@ -169,11 +169,7 @@ static struct stat_col ssl_stats[] = {
.desc = "Total number of failed handshake" },
};
static struct ssl_counters {
long long sess;
long long reused_sess;
long long failed_handshake;
} ssl_counters;
static struct ssl_counters ssl_counters;
static int ssl_fill_stats(void *data, struct field *stats, unsigned int *selected_field)
{
@ -208,7 +204,7 @@ static int ssl_fill_stats(void *data, struct field *stats, unsigned int *selecte
return 1;
}
static struct stats_module ssl_stats_module = {
struct stats_module ssl_stats_module = {
.name = "ssl",
.fill_stats = ssl_fill_stats,
.stats = ssl_stats,