mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 22:28:41 -04:00
MINOR: server/event_hdl: prepare for upcoming refactors
This commit does nothing that ought to be mentioned, except that it adds missing comments and slighty moves some function calls out of "sensitive" code in preparation of some server code refactors.
This commit is contained in:
parent
2f6a07dce8
commit
a63f4903c9
2 changed files with 11 additions and 9 deletions
|
|
@ -420,6 +420,8 @@ struct server {
|
|||
struct event_hdl_cb_data_server {
|
||||
/* provided by:
|
||||
* EVENT_HDL_SUB_SERVER_ADD
|
||||
* EVENT_HDL_SUB_SERVER_DEL
|
||||
* EVENT_HDL_SUB_SERVER_UP
|
||||
* EVENT_HDL_SUB_SERVER_DOWN
|
||||
*/
|
||||
struct {
|
||||
|
|
|
|||
18
src/server.c
18
src/server.c
|
|
@ -5301,9 +5301,6 @@ static void srv_update_status(struct server *s)
|
|||
s->next_admin = s->cur_admin;
|
||||
|
||||
if ((s->cur_state != SRV_ST_STOPPED) && (s->next_state == SRV_ST_STOPPED)) {
|
||||
/* no maintenance + server DOWN: publish event SERVER DOWN */
|
||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
||||
|
||||
s->last_change = now.tv_sec;
|
||||
if (s->proxy->lbprm.set_server_status_down)
|
||||
s->proxy->lbprm.set_server_status_down(s);
|
||||
|
|
@ -5317,6 +5314,9 @@ static void srv_update_status(struct server *s)
|
|||
*/
|
||||
xferred = pendconn_redistribute(s);
|
||||
|
||||
/* no maintenance + server DOWN: publish event SERVER DOWN */
|
||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
||||
|
||||
tmptrash = alloc_trash_chunk();
|
||||
if (tmptrash) {
|
||||
chunk_printf(tmptrash,
|
||||
|
|
@ -5371,9 +5371,6 @@ static void srv_update_status(struct server *s)
|
|||
}
|
||||
else if (((s->cur_state != SRV_ST_RUNNING) && (s->next_state == SRV_ST_RUNNING))
|
||||
|| ((s->cur_state != SRV_ST_STARTING) && (s->next_state == SRV_ST_STARTING))) {
|
||||
/* no maintenance + server going UP: publish event SERVER UP */
|
||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_UP, s, 0);
|
||||
|
||||
if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) {
|
||||
if (s->proxy->last_change < now.tv_sec) // ignore negative times
|
||||
s->proxy->down_time += now.tv_sec - s->proxy->last_change;
|
||||
|
|
@ -5414,6 +5411,9 @@ static void srv_update_status(struct server *s)
|
|||
*/
|
||||
xferred = pendconn_grab_from_px(s);
|
||||
|
||||
/* no maintenance + server going UP: publish event SERVER UP */
|
||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_UP, s, 0);
|
||||
|
||||
tmptrash = alloc_trash_chunk();
|
||||
if (tmptrash) {
|
||||
chunk_printf(tmptrash,
|
||||
|
|
@ -5500,9 +5500,6 @@ static void srv_update_status(struct server *s)
|
|||
if (s->onmarkeddown & HANA_ONMARKEDDOWN_SHUTDOWNSESSIONS)
|
||||
srv_shutdown_streams(s, SF_ERR_DOWN);
|
||||
|
||||
/* maintenance on previously running server: publish event SERVER DOWN */
|
||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
||||
|
||||
/* force connection cleanup on the given server */
|
||||
srv_cleanup_connections(s);
|
||||
/* we might have streams queued on this server and waiting for
|
||||
|
|
@ -5511,6 +5508,9 @@ static void srv_update_status(struct server *s)
|
|||
*/
|
||||
xferred = pendconn_redistribute(s);
|
||||
|
||||
/* maintenance on previously running server: publish event SERVER DOWN */
|
||||
srv_event_hdl_publish(EVENT_HDL_SUB_SERVER_DOWN, s, 0);
|
||||
|
||||
tmptrash = alloc_trash_chunk();
|
||||
if (tmptrash) {
|
||||
chunk_printf(tmptrash,
|
||||
|
|
|
|||
Loading…
Reference in a new issue