Skip to content

Commit

Permalink
Arrange code according to the frst set of comments on the PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfclere committed Sep 6, 2023
1 parent 66cb5bc commit 69b654e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 33 deletions.
1 change: 1 addition & 0 deletions modules/proxy/balancers/mod_lbmethod_bybusyness.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "mod_proxy.h"
#include "proxy_util.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "apr_version.h"
Expand Down
34 changes: 1 addition & 33 deletions modules/proxy/mod_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ typedef struct {
apr_size_t recv_buffer_size;
apr_size_t io_buffer_size;
apr_size_t elected; /* Number of times the worker was elected */
volatile apr_size_t busy; /* busyness factor */
apr_size_t busy; /* busyness factor */
apr_size_t response_field_size; /* Size of proxy response buffer in bytes. */
apr_port_t port;
apr_off_t transferred;/* Number of bytes transferred to remote */
Expand Down Expand Up @@ -1577,38 +1577,6 @@ PROXY_DECLARE(apr_status_t) ap_proxy_transfer_between_connections(
int *sent,
apr_off_t bsize,
int flags);
/*
* Get the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @return apr_size_t value atomically read for the worker.
*/
PROXY_DECLARE(apr_size_t) getbusy_count(void *worker_);

/*
* Set the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @param busy value to set the busy counter.
* @return void
*/
PROXY_DECLARE(void) setbusy_count(void *worker_, apr_size_t busy);

/*
* decrement the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @return apr_status_t returns APR_SUCCESS.
*/
PROXY_DECLARE(apr_status_t) decrement_busy_count(void *worker_);

/*
* increment the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @return void
*/
PROXY_DECLARE(void) increment_busy_count(void *worker_);

extern module PROXY_DECLARE_DATA proxy_module;

Expand Down
1 change: 1 addition & 0 deletions modules/proxy/mod_proxy_balancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/* Load balancer module for Apache proxy */

#include "mod_proxy.h"
#include "proxy_util.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "apr_version.h"
Expand Down
33 changes: 33 additions & 0 deletions modules/proxy/proxy_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,39 @@ extern PROXY_DECLARE_DATA const apr_strmatch_pattern *ap_proxy_strmatch_domain;
*/
void proxy_util_register_hooks(apr_pool_t *p);

/*
* Get the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @return apr_size_t value atomically read for the worker.
*/
PROXY_DECLARE(apr_size_t) getbusy_count(void *worker_);

/*
* Set the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @param busy value to set the busy counter.
* @return void
*/
PROXY_DECLARE(void) setbusy_count(void *worker_, apr_size_t busy);

/*
* decrement the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @return apr_status_t returns APR_SUCCESS.
*/
PROXY_DECLARE(apr_status_t) decrement_busy_count(void *worker_);

/*
* increment the busy counter from the shared worker memory
*
* @param worker_ Pointer to the worker structure.
* @return void
*/
PROXY_DECLARE(void) increment_busy_count(void *worker_);

/** @} */

#endif /* PROXY_UTIL_H_ */

0 comments on commit 69b654e

Please sign in to comment.