refactor: rename proto inc and dec functions for clarity

This commit is contained in:
yrutschle committed 2025-08-06 09:36:39 +02:00
1 parent 4483e9c7e5
commit 8c4253f145
5 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -600,7 +600,7 @@ void dump_connection(struct connection *cnx)
/* *cnx must have its proto field probed already.
* If required, increment the connection count for this protocol.
* Returns 1 if connection count is exceeded, 0 otherwise */
int inc_connections(struct connection* cnx)
int inc_proto_connections(struct connection* cnx)
{
cnx->proto->num_connections++;
if (cnx->proto->max_connections_is_present) {
@@ -616,7 +616,7 @@ int inc_connections(struct connection* cnx)
return 0;
}
void dec_connections(struct connection* cnx)
void dec_proto_connections(struct connection* cnx)
{
if (cnx->proto) {
cnx->proto->num_connections--;
+2 -2
View File
@@ -177,8 +177,8 @@ void drop_privileges(const char* user_name, const char* chroot_path);
void set_capabilities(int cap_net_admin);
void write_pid_file(const char* pidfile);
void dump_connection(struct connection *cnx);
int inc_connections(struct connection* cnx);
void dec_connections(struct connection* cnx);
int inc_proto_connections(struct connection* cnx);
void dec_proto_connections(struct connection* cnx);
int resolve_split_name(struct addrinfo **out, char* hostname, char* port);
int start_listen_sockets(struct listen_endpoint *sockfd[]);
+1 -1
View File
@@ -49,7 +49,7 @@ int tidy_connection(struct connection *cnx, struct loop_info* fd_info)
if (gap_remove_ptr(fd_info->probing_list, cnx, fd_info->num_probing) != -1)
fd_info->num_probing--;
dec_connections(cnx);
dec_proto_connections(cnx);
dec_listen_connections(cnx);
collection_remove_cnx(fd_info->collection, cnx);
+1 -1
View File
@@ -313,7 +313,7 @@ void probing_read_process(struct connection* cnx,
remove_probing_cnx(fd_info, cnx);
cnx->state = ST_SHOVELING;
if (inc_connections(cnx)) {
if (inc_proto_connections(cnx)) {
tidy_connection(cnx, fd_info);
return;
}
+1 -1
View File
@@ -302,7 +302,7 @@ struct connection* udp_c2s_forward(int sockfd, struct loop_info* fd_info)
cnx->addrlen = addrlen;
cnx->local_endpoint = sockfd;
if (inc_connections(cnx)) {
if (inc_proto_connections(cnx)) {
tidy_connection(cnx, fd_info);
return NULL;
}