]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] proxy: move PR_O_SSL3_CHK to options2 to release one flag
authorWilly Tarreau <w@1wt.eu>
Mon, 29 Mar 2010 16:33:29 +0000 (18:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 30 Mar 2010 07:59:43 +0000 (09:59 +0200)
We'll need another flag in the 'options' member close to PR_O_TPXY_*,
and all are used, so let's move this easy one to options2 (which are
already used for SQL checks).

include/types/proxy.h
src/cfgparse.c
src/checks.c

index 53c00f71e7743f9398d0bc0e28c5c0d5e04d0ef4..13b5f2a52178c76052c91be0bcbf52dd72c3e2f7 100644 (file)
@@ -94,7 +94,6 @@
 #define PR_O_FORCE_CLO  0x00200000      /* enforce the connection close immediately after server response */
 #define PR_O_TCP_NOLING 0x00400000      /* disable lingering on client and server connections */
 #define PR_O_ABRT_CLOSE 0x00800000      /* immediately abort request when client closes */
-#define PR_O_SSL3_CHK   0x01000000      /* use SSLv3 CLIENT_HELLO packets for server health */
 
 /* TPXY: exclusive values */
 #define PR_O_TPXY_ADDR  0x02000000     /* bind to this non-local address when connect()ing */
 #define PR_O2_MYSQL_CHK 0x00020000      /* use MYSQL check for server health */
 #define PR_O2_USE_PXHDR 0x00040000      /* use Proxy-Connection for proxy requests */
 #define PR_O2_CHK_SNDST 0x00080000      /* send the state of each server along with HTTP health checks */
+#define PR_O2_SSL3_CHK  0x00100000      /* use SSLv3 CLIENT_HELLO packets for server health */
 /* end of proxy->options2 */
 
 /* bits for sticking rules */
index 645c631c8cc8db308fd384b3f8cd2e52d877994e..b647ff2ae1a2e7ce27142359a149fbecc69f5ac7 100644 (file)
@@ -2667,8 +2667,8 @@ stats_error_parsing:
                        /* use HTTP request to check servers' health */
                        free(curproxy->check_req);
                        curproxy->check_req = NULL;
-                       curproxy->options &= ~PR_O_SSL3_CHK;
                        curproxy->options &= ~PR_O_SMTP_CHK;
+                       curproxy->options2 &= ~PR_O2_SSL3_CHK;
                        curproxy->options2 &= ~PR_O2_MYSQL_CHK;
                        curproxy->options |= PR_O_HTTP_CHK;
                        if (!*args[2]) { /* no argument */
@@ -2701,14 +2701,14 @@ stats_error_parsing:
                        curproxy->options &= ~PR_O_HTTP_CHK;
                        curproxy->options &= ~PR_O_SMTP_CHK;
                        curproxy->options2 &= ~PR_O2_MYSQL_CHK;
-                       curproxy->options |= PR_O_SSL3_CHK;
+                       curproxy->options2 |= PR_O2_SSL3_CHK;
                }
                else if (!strcmp(args[1], "smtpchk")) {
                        /* use SMTP request to check servers' health */
                        free(curproxy->check_req);
                        curproxy->check_req = NULL;
                        curproxy->options &= ~PR_O_HTTP_CHK;
-                       curproxy->options &= ~PR_O_SSL3_CHK;
+                       curproxy->options2 &= ~PR_O2_SSL3_CHK;
                        curproxy->options2 &= ~PR_O2_MYSQL_CHK;
                        curproxy->options |= PR_O_SMTP_CHK;
 
@@ -2734,8 +2734,8 @@ stats_error_parsing:
                        free(curproxy->check_req);
                        curproxy->check_req = NULL;
                        curproxy->options &= ~PR_O_HTTP_CHK;
-                       curproxy->options &= ~PR_O_SSL3_CHK;
                        curproxy->options &= ~PR_O_SMTP_CHK;
+                       curproxy->options2 &= ~PR_O2_SSL3_CHK;
                        curproxy->options2 |= PR_O2_MYSQL_CHK;
                }
                else if (!strcmp(args[1], "forwardfor")) {
@@ -4915,7 +4915,7 @@ out_uri_auth_compat:
                        }
                }
 
-               if (curproxy->options & PR_O_SSL3_CHK) {
+               if (curproxy->options2 & PR_O2_SSL3_CHK) {
                        curproxy->check_len = sizeof(sslv3_client_hello_pkt) - 1;
                        curproxy->check_req = (char *)malloc(curproxy->check_len);
                        memcpy(curproxy->check_req, sslv3_client_hello_pkt, curproxy->check_len);
index e6fec7dfe93f74da80a0ed69617b28bc4de90ebc..d326625be84ce08e775461bb1cfcd704491ffef2 100644 (file)
@@ -741,8 +741,8 @@ static int event_srv_chk_w(int fd)
        if (!(s->result & SRV_CHK_ERROR)) {
                /* we don't want to mark 'UP' a server on which we detected an error earlier */
                if ((s->proxy->options & PR_O_HTTP_CHK) ||
-                   (s->proxy->options & PR_O_SSL3_CHK) ||
                    (s->proxy->options & PR_O_SMTP_CHK) ||
+                   (s->proxy->options2 & PR_O2_SSL3_CHK) ||
                    (s->proxy->options2 & PR_O2_MYSQL_CHK)) {
                        int ret;
                        const char *check_req = s->proxy->check_req;
@@ -752,7 +752,7 @@ static int event_srv_chk_w(int fd)
                         * so we'll send the request, and won't wake the checker up now.
                         */
 
-                       if (s->proxy->options & PR_O_SSL3_CHK) {
+                       if (s->proxy->options2 & PR_O2_SSL3_CHK) {
                                /* SSL requires that we put Unix time in the request */
                                int gmt_time = htonl(date.tv_sec);
                                memcpy(s->proxy->check_req + 11, &gmt_time, 4);
@@ -956,7 +956,7 @@ static int event_srv_chk_r(int fd)
                        set_server_check_status(s, HCHK_STATUS_L7STS, desc);
                }
        }
-       else if (s->proxy->options & PR_O_SSL3_CHK) {
+       else if (s->proxy->options2 & PR_O2_SSL3_CHK) {
                if (!done && s->check_data_len < 5)
                        goto wait_more_data;
 
@@ -1359,7 +1359,7 @@ struct task *process_chk(struct task *t)
                                if (!EV_FD_ISSET(fd, DIR_RD)) {
                                        set_server_check_status(s, HCHK_STATUS_L4TOUT, NULL);
                                } else {
-                                       if (s->proxy->options & PR_O_SSL3_CHK)
+                                       if (s->proxy->options2 & PR_O2_SSL3_CHK)
                                                set_server_check_status(s, HCHK_STATUS_L6TOUT, NULL);
                                        else    /* HTTP, SMTP */
                                                set_server_check_status(s, HCHK_STATUS_L7TOUT, NULL);