Skip to content

Commit

Permalink
[#422] Add short comments, logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
T1t4m1un committed Mar 26, 2024
1 parent dba3767 commit 618131b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/libpgagroal/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -2397,15 +2397,19 @@ is_same_server(struct server* s1, struct server* s2)
}
}

/**
* Checks if TLS configurations are same.
* @return true if the TLS configurations are same
*/
static bool
is_same_tls(struct server* src, struct server* dst)
{
if (src->tls == dst->tls ||
!strncmp(src->tls_cert_file, dst->tls_cert_file, MISC_LENGTH)||
!strncmp(src->tls_key_file, dst->tls_key_file, MISC_LENGTH)||
if (src->tls == dst->tls &&
!strncmp(src->tls_cert_file, dst->tls_cert_file, MISC_LENGTH) &&
!strncmp(src->tls_key_file, dst->tls_key_file, MISC_LENGTH) &&
!strncmp(src->tls_ca_file, dst->tls_ca_file, MISC_LENGTH))
{
return false;
return true;
}
else
{
Expand Down Expand Up @@ -2464,6 +2468,10 @@ restart_int(char* name, int e, int n)
return 0;
}

/**
* Utility function prints a line in the log when a restart is required.
* @return 0 when parameter values are same, 1 when a restart required.
*/
static int
restart_bool(char* name, bool e, bool n)
{
Expand Down

0 comments on commit 618131b

Please sign in to comment.