Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-signal committed May 28, 2024
1 parent cc9d0bd commit 1e5ed96
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/apps/relay/ns_ioalib_engine_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3686,7 +3686,7 @@ void turn_report_allocation_set(void *a, turn_time_t lifetime, int refresh) {
}
#endif
{
// Signal change to add address family label
// Signal change to add address family label
if (!refresh) {
prom_inc_allocation(get_ioa_socket_type(ss->client_socket),
get_ioa_socket_address_family(ss->client_socket), ss->protocolgroup);
Expand Down
15 changes: 13 additions & 2 deletions src/apps/relay/prom_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,19 @@ void prom_set_finished_traffic(const char *realm, const char *user, unsigned lon
UNUSED_ARG(protocolgroup);
}

void prom_inc_allocation(SOCKET_TYPE type) { UNUSED_ARG(type); }
void prom_inc_allocation(SOCKET_TYPE type, int addr_family, const char *protocolgroup) {
UNUSED_ARG(type);
UNUSED_ARG(addr_family);
UNUSED_ARG(protocolgroup);
}

void prom_dec_allocation(SOCKET_TYPE type) { UNUSED_ARG(type); }
void prom_dec_allocation(SOCKET_TYPE type, int addr_family, unsigned long duration, unsigned long sent_rate_kbps,
const char *protocolgroup) {
UNUSED_ARG(type);
UNUSED_ARG(addr_family);
UNUSED_ARG(duration);
UNUSED_ARG(sent_rate_kbps);
UNUSED_ARG(protocolgroup);
}

#endif /* TURN_NO_PROMETHEUS */
5 changes: 3 additions & 2 deletions src/apps/relay/prom_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ void prom_set_finished_traffic(const char *realm, const char *user, unsigned lon
unsigned long sentp, unsigned long sentb, unsigned long without_pingp, bool peer,
const char *protocolgroup);

void prom_inc_allocation(SOCKET_TYPE type);
void prom_dec_allocation(SOCKET_TYPE type);
void prom_inc_allocation(SOCKET_TYPE type, int addr_family, const char *protocolgroup);
void prom_dec_allocation(SOCKET_TYPE type, int addr_family, unsigned long duration, unsigned long sent_rate_kbps,
const char *protocolgroup);

#endif /* TURN_NO_PROMETHEUS */

Expand Down
4 changes: 2 additions & 2 deletions src/apps/relay/userdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ int add_static_user_account(char *user) {
return -1;
}

// key argument (the usname variable) is deep-copied, so ownership isn't transfered, and we still need to free usname later..
// value argument (the key variable) has ownership transfered into this function
// key argument (the usname variable) is deep-copied, so ownership isn't transfered, and we still need to free usname
// later.. value argument (the key variable) has ownership transfered into this function
ur_string_map_put(turn_params.default_users_db.ram_db.static_accounts, (ur_string_map_key_type)usname,
(ur_string_map_value_type)*key);
ur_string_map_unlock(turn_params.default_users_db.ram_db.static_accounts);
Expand Down
12 changes: 6 additions & 6 deletions src/server/ns_turn_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -3237,12 +3237,12 @@ static int handle_turn_create_permission(turn_turnserver *server, ts_ur_super_se
if (!get_relay_socket(a, peer_addr.ss.sa_family)) {
*err_code = 443;
*reason = (const uint8_t *)"Peer Address Family Mismatch (4)";
// Signal change to accept but ignore perrmissions to forbidden IPs
/*
} else if (!good_peer_addr(server, ss->realm_options.name, &peer_addr, ss->id)) {
*err_code = 403;
*reason = (const uint8_t *)"Forbidden IP";
*/
// Signal change to accept but ignore perrmissions to forbidden IPs
/*
} else if (!good_peer_addr(server, ss->realm_options.name, &peer_addr, ss->id)) {
*err_code = 403;
*reason = (const uint8_t *)"Forbidden IP";
*/
} else {
addr_found++;
}
Expand Down

0 comments on commit 1e5ed96

Please sign in to comment.