mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-25 04:17:42 +00:00
MAJOR: spoe: refactor the filter to clean up the code
The SPOE code is now pretty big and it was the good time to clean it up. It is not perfect, some parts remains a bit ugly. But it is far better now.
This commit is contained in:
parent
850103546c
commit
8ef75251e3
@ -52,8 +52,8 @@ void send_email_alert(struct server *s, int priority, const char *format, ...)
|
||||
int srv_check_healthcheck_port(struct check *chk);
|
||||
|
||||
/* Declared here, but the definitions are in flt_spoe.c */
|
||||
int prepare_spoe_healthcheck_request(char **req, int *len);
|
||||
int handle_spoe_healthcheck_response(char *frame, size_t size, char *err, int errlen);
|
||||
int spoe_prepare_healthcheck_request(char **req, int *len);
|
||||
int spoe_handle_healthcheck_response(char *frame, size_t size, char *err, int errlen);
|
||||
|
||||
#endif /* _PROTO_CHECKS_H */
|
||||
|
||||
|
@ -4921,7 +4921,7 @@ stats_error_parsing:
|
||||
curproxy->options2 &= ~PR_O2_CHK_ANY;
|
||||
curproxy->options2 |= PR_O2_SPOP_CHK;
|
||||
|
||||
if (prepare_spoe_healthcheck_request(&curproxy->check_req, &curproxy->check_len)) {
|
||||
if (spoe_prepare_healthcheck_request(&curproxy->check_req, &curproxy->check_len)) {
|
||||
Alert("parsing [%s:%d] : failed to prepare SPOP healthcheck request.\n", file, linenum);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
|
@ -1328,7 +1328,7 @@ static void event_srv_chk_r(struct connection *conn)
|
||||
if (!done && check->bi->i < (4+framesz))
|
||||
goto wait_more_data;
|
||||
|
||||
if (!handle_spoe_healthcheck_response(check->bi->data+4, framesz, err, HCHK_DESC_LEN-1))
|
||||
if (!spoe_handle_healthcheck_response(check->bi->data+4, framesz, err, HCHK_DESC_LEN-1))
|
||||
set_server_check_status(check, HCHK_STATUS_L7OKD, "SPOA server is ok");
|
||||
else
|
||||
set_server_check_status(check, HCHK_STATUS_L7STS, err);
|
||||
|
2305
src/flt_spoe.c
2305
src/flt_spoe.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user