Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci-ignored-workaround.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
- name: Skip
run: echo "Skipping the job"

clang-tidy-naming-check:
runs-on: ubuntu-latest
steps:
- name: Skip
run: echo "Skipping the job"

make-fedora-latest:
runs-on: ubuntu-latest
steps:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,33 @@ jobs:
done;
exit $code

clang-tidy-naming-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: mod_proxy_cluster
- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy
- name: Check naming conventions
run: |
code=0
cd mod_proxy_cluster/native
for file in */*.c */*.h; do
output=$(clang-tidy --checks='-*,readability-identifier-naming' "$file" -- -I/usr/include/apache2 -I/usr/include/apr-1.0 2>&1 | grep 'warning:.*identifier naming' || true)
Copy link
Copy Markdown
Member

@jajik jajik May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work. When clang-tidy encounters an error before finding anything, this will report OK without checking the file.

This also expects apache and apr installed, so maybe it should depend on some compilation job (see perl tests).

if [ -z "$output" ]; then
printf "%-42s ... OK\n" "$file"
else
echo "$output"
printf "%-42s ... NOK\n" "$file"
code=1
fi
done
exit $code

make-httpd-maintainer-mode:
runs-on: ubuntu-latest
strategy:
Expand Down
8 changes: 8 additions & 0 deletions native/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Checks: '-*,readability-identifier-naming'
CheckOptions:
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.MemberCase
value: lower_case
2 changes: 1 addition & 1 deletion native/balancers/mod_lbmethod_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static struct domain_storage_method *domain_storage = NULL;
static apr_table_t *proxyhctemplate;
static void (*set_proxyhctemplate_f)(apr_pool_t *, apr_table_t *) = NULL;

static int use_alias = 0; /* 1 : Compare Alias with server_name */
static int use_alias = 0; /* 1 : Compare alias with server_name */
static int use_nocanon = 0;
static apr_time_t lbstatus_recalc_time =
apr_time_from_sec(5); /* recalcul the lbstatus based on number of request in the time interval */
Expand Down
8 changes: 4 additions & 4 deletions native/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,11 @@ static apr_status_t find_nodedomain(request_rec *r, const char **domain, char *r
/* XXX JFCLERE!!!! domaininfo_t *dom; */
ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, r->server, "find_nodedomain: finding node for %s: %s", route, balancer);
for (i = 0; i < node_table->sizenode; i++) {
if (strcmp(node_table->node_info[i].mess.JVMRoute, route) == 0) {
if (strcmp(node_table->node_info[i].mess.jvm_route, route) == 0) {
const nodeinfo_t *ou = &node_table->node_info[i];
if (!strcasecmp(balancer, ou->mess.balancer)) {
if (ou->mess.Domain[0] != '\0') {
*domain = ou->mess.Domain;
if (ou->mess.domain[0] != '\0') {
*domain = ou->mess.domain;
}
return APR_SUCCESS;
}
Expand Down Expand Up @@ -600,7 +600,7 @@ nodeinfo_t *table_get_node_route(proxy_node_table *node_table, char *route, int
{
int i;
for (i = 0; i < node_table->sizenode; i++) {
if (!strcmp(node_table->node_info[i].mess.JVMRoute, route)) {
if (!strcmp(node_table->node_info[i].mess.jvm_route, route)) {
*id = node_table->nodes[i];
return &node_table->node_info[i];
}
Expand Down
14 changes: 7 additions & 7 deletions native/include/balancer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ struct balancerinfo
/* NOTE: Due to `loc_get_id`, struct MUST begin with id */
int id; /* id in table */
char balancer[BALANCERSZ]; /* Name of the balancer */
int StickySession; /* 0 : Don't use, 1: Use it */
char StickySessionCookie[COOKNAMESZ];
char StickySessionPath[PATHNAMESZ];
int StickySessionRemove; /* 0 : Don't remove, 1: Remove it */
int StickySessionForce; /* 0: Don't force, 1: return error */
int Timeout;
int Maxattempts;
int sticky_session; /* 0 : Don't use, 1: Use it */
char sticky_session_cookie[COOKNAMESZ];
char sticky_session_path[PATHNAMESZ];
int sticky_session_remove; /* 0 : Don't remove, 1: Remove it */
int sticky_session_force; /* 0: Don't force, 1: return error */
int timeout;
int max_attempts;

apr_time_t updatetime; /* time of last received message */
};
Expand Down
14 changes: 7 additions & 7 deletions native/include/domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ typedef struct mem mem_t;
struct domaininfo
{
/* NOTE: Due to `loc_get_id`, struct MUST begin with id */
int id; /* id in table */
char domain[DOMAINNDSZ]; /* domain value */
char JVMRoute[JVMROUTESZ]; /* corresponding node */
char balancer[BALANCERSZ]; /* name of the balancer */
int id; /* id in table */
char domain[DOMAINNDSZ]; /* domain value */
char jvm_route[JVMROUTESZ]; /* corresponding node */
char balancer[BALANCERSZ]; /* name of the balancer */

apr_time_t updatetime; /* time of last received message */
};
Expand Down Expand Up @@ -74,10 +74,10 @@ apr_status_t get_domain(mem_t *s, domaininfo_t **domain, int ids);
apr_status_t remove_domain(mem_t *s, domaininfo_t *domain);

/**
* Find a domain record from the shared table using JVMRoute and balancer
* Find a domain record from the shared table using jvm_route and balancer
* @param s pointer to the shared table
* @param domain address where the node is located in the shared table
* @param route JVMRoute to search
* @param route jvm_route to search
* @param balancer balancer to search
* @return APR_SUCCESS if all went well
*/
Expand Down Expand Up @@ -153,7 +153,7 @@ struct domain_storage_method
*/
apr_status_t (*insert_update_domain)(domaininfo_t *domain);
/**
* Find the domain using the JVMRoute and balancer information
* Find the domain using the jvm_route and balancer information
* @return APR_SUCCESS if all went well
*/
apr_status_t (*find_domain)(domaininfo_t **node, const char *route, const char *balancer);
Expand Down
2 changes: 1 addition & 1 deletion native/include/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct hostinfo
{
/* NOTE: Due to `loc_get_id`, struct MUST begin with id */
int id; /* id in table */
char host[HOSTALIASZ + 1]; /* Alias element of the virtual host */
char host[HOSTALIASZ + 1]; /* alias element of the virtual host */
int vhost; /* id of the correspond virtual host */
int node; /* id of the node containing the virtual host */

Expand Down
24 changes: 12 additions & 12 deletions native/include/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ struct nodemess

/* balancer info */
char balancer[BALANCERSZ]; /* name of the balancer */
char JVMRoute[JVMROUTESZ];
char Domain[DOMAINNDSZ];
char Host[HOSTNODESZ];
char Port[PORTNODESZ];
char Type[SCHEMENDSZ];
char Upgrade[SCHEMENDSZ];
char AJPSecret[AJPSECRETSZ];
char jvm_route[JVMROUTESZ];
char domain[DOMAINNDSZ];
char host[HOSTNODESZ];
char port[PORTNODESZ];
char type[SCHEMENDSZ];
char upgrade[SCHEMENDSZ];
char ajp_secret[AJPSECRETSZ];
int reversed; /* 1 : reversed... 0 : normal */
int remove; /* 1 : removed 0 : normal */
long ResponseFieldSize;
long response_field_size;
unsigned has_workers;

/* node conf part */
Expand Down Expand Up @@ -126,16 +126,16 @@ apr_status_t get_node(mem_t *s, nodeinfo_t **node, int ids);
apr_status_t remove_node(mem_t *s, int ids);

/**
* Find a node record from the shared table using JVMRoute
* Find a node record from the shared table using jvm_route
* @param s pointer to the shared table
* @param node address where the node is located in the shared table
* @param route JVMRoute to search
* @param route jvm_route to search
* @return APR_SUCCESS if all went well
*/
apr_status_t find_node(mem_t *s, nodeinfo_t **node, const char *route);

/**
* Find a node record from the shared table using Host/Port
* Find a node record from the shared table using host/port
* @param s pointer to the shared table
* @param node address where the node is located in the shared table
* @param host host to search
Expand Down Expand Up @@ -227,7 +227,7 @@ struct node_storage_method
*/
int (*remove_node)(int node);
/**
* Find the node using the JVMRoute information
* Find the node using the jvm_route information
*/
apr_status_t (*find_node)(nodeinfo_t **node, const char *route);
/**
Expand Down
2 changes: 1 addition & 1 deletion native/include/sessionid.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct sessionidinfo
/* NOTE: Due to `loc_get_id`, struct MUST begin with id */
int id; /* id in table */
char sessionid[SESSIONIDSZ + 1]; /* Sessionid value */
char JVMRoute[JVMROUTESZ + 1]; /* corresponding node */
char jvm_route[JVMROUTESZ + 1]; /* corresponding node */

apr_time_t updatetime; /* time of last received message */
};
Expand Down
8 changes: 4 additions & 4 deletions native/mod_manager/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static apr_status_t update(void *mem, void *data, apr_pool_t *pool)
domaininfo_t *ou = (domaininfo_t *)mem;
(void)pool;

if (strcmp(in->JVMRoute, ou->JVMRoute) == 0 && strcmp(in->balancer, ou->balancer) == 0) {
if (strcmp(in->jvm_route, ou->jvm_route) == 0 && strcmp(in->balancer, ou->balancer) == 0) {
in->id = ou->id;
memcpy(ou, in, sizeof(domaininfo_t));
ou->updatetime = apr_time_sec(apr_time_now());
Expand Down Expand Up @@ -104,7 +104,7 @@ static apr_status_t loc_read_domain(void *mem, void *data, apr_pool_t *pool)
domaininfo_t *ou = (domaininfo_t *)mem;
(void)pool;

if (strcmp(in->JVMRoute, ou->JVMRoute) == 0 && strcmp(in->balancer, ou->balancer) == 0) {
if (strcmp(in->jvm_route, ou->jvm_route) == 0 && strcmp(in->balancer, ou->balancer) == 0) {
in->id = ou->id;
return APR_EEXIST;
}
Expand Down Expand Up @@ -155,8 +155,8 @@ apr_status_t find_domain(mem_t *s, domaininfo_t **domain, const char *route, con
domaininfo_t ou;
apr_status_t rv;

strncpy(ou.JVMRoute, route, sizeof(ou.JVMRoute));
ou.JVMRoute[sizeof(ou.JVMRoute) - 1] = '\0';
strncpy(ou.jvm_route, route, sizeof(ou.jvm_route));
ou.jvm_route[sizeof(ou.jvm_route) - 1] = '\0';
strncpy(ou.balancer, balancer, sizeof(ou.balancer));
ou.balancer[sizeof(ou.balancer) - 1] = '\0';
*domain = &ou;
Expand Down
Loading
Loading