diff --git a/common.c b/common.c index 590fbc2..5039cb2 100644 --- a/common.c +++ b/common.c @@ -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--; diff --git a/common.h b/common.h index 629f580..b55cc1a 100644 --- a/common.h +++ b/common.h @@ -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[]); diff --git a/processes.c b/processes.c index 68ea4b6..82afd59 100644 --- a/processes.c +++ b/processes.c @@ -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); diff --git a/tcp-listener.c b/tcp-listener.c index b6b1e4c..073d4ea 100644 --- a/tcp-listener.c +++ b/tcp-listener.c @@ -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; } diff --git a/udp-listener.c b/udp-listener.c index 4f967a2..13996a3 100644 --- a/udp-listener.c +++ b/udp-listener.c @@ -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; }