Skip to content

Commit

Permalink
Merge pull request #268 from jajik/lbstatus-update
Browse files Browse the repository at this point in the history
Simplify and fix updating lbstatus, minor tweaks
  • Loading branch information
jajik authored Aug 21, 2024
2 parents 6877c0a + b141fe6 commit bb27794
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions native/mod_proxy_cluster/mod_proxy_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,8 @@ static apr_status_t http_handle_cping_cpong(proxy_conn_rec *p_conn, request_rec
len = 0;
while (!eos) {
apr_brigade_cleanup(brigade);
if (APR_SUCCESS !=
ap_get_brigade(p_conn->connection->input_filters, brigade, AP_MODE_GETLINE, APR_BLOCK_READ, 0)) {
if ((rv = ap_get_brigade(p_conn->connection->input_filters, brigade, AP_MODE_GETLINE, APR_BLOCK_READ, 0)) !=
APR_SUCCESS) {
if (len != 0) {
/* We have read something already... */
break;
Expand Down Expand Up @@ -1343,7 +1343,7 @@ static void update_lbstatus_failure_idle(nodeinfo_t *ou, proxy_worker *worker, a
}
}

/* Returns 1 if the caller function should continue processing.
/* Returns 1 if check was done, 0 in case the old method should be used.
* NOTE: node_storage must be locked!
*/
static int update_lbstatus_hcheck(proxy_server_conf *conf, server_rec *server, apr_time_t now, nodeinfo_t *ou, int id,
Expand Down Expand Up @@ -1501,17 +1501,16 @@ static void update_workers_lbstatus(proxy_server_conf *conf, apr_pool_t *pool, s
/* worker->s->retries is also set to zero is a connection is */
/* establish so we use read to check for changes */
proxy_worker *worker = update_lbstatus_get_worker(server, conf, ou, ids[i], stat);
if (update_lbstatus_hcheck(conf, server, now, ou, ids[i], stat)) {
if (!update_lbstatus_hcheck(conf, server, now, ou, ids[i], stat)) {
node_storage->unlock_nodes();
return;
}
/* We must unlock because check_proxy_worker takes care of locking by itself. */
/* Don't forget it may or may not be scheduled for another thread. */
node_storage->unlock_nodes();
if (!update_lbstatus_oldcheck(conf, pool, server, now, ou, ids[i], worker)) {
return;
/* We must unlock because check_proxy_worker takes care of locking by itself. */
/* Don't forget it may or may not be scheduled for another thread. */
if (!update_lbstatus_oldcheck(conf, pool, server, now, ou, ids[i], worker)) {
return;
}
/* continue, because we've already unlocked */
continue;
}
continue;
} else {
ou->mess.num_failure_idle = 0;
}
Expand Down

0 comments on commit bb27794

Please sign in to comment.