mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-28 08:30:46 +00:00
BUILD: httpclient: fix build without SSL
src/http_client.c: In function ‘httpclient_cfg_postparser’:
src/http_client.c:1065:8: error: unused variable ‘errmsg’ [-Werror=unused-variable]
1065 | char *errmsg = NULL;
| ^~~~~~
src/http_client.c:1064:6: error: unused variable ‘err_code’ [-Werror=unused-variable]
1064 | int err_code = 0;
| ^~~~~~~~
Fix the build of the httpclient without SSL, the problem was introduced
with previous patch 71e3158
("BUG/MINOR: httpclient: send the SNI using
the host header")
Must be backported in 2.5 as well.
This commit is contained in:
parent
71e3158395
commit
715c101a19
@ -1061,7 +1061,6 @@ static int httpclient_cfg_postparser()
|
|||||||
{
|
{
|
||||||
struct logsrv *logsrv;
|
struct logsrv *logsrv;
|
||||||
struct proxy *curproxy = httpclient_proxy;
|
struct proxy *curproxy = httpclient_proxy;
|
||||||
int err_code = 0;
|
|
||||||
char *errmsg = NULL;
|
char *errmsg = NULL;
|
||||||
|
|
||||||
/* copy logs from "global" log list */
|
/* copy logs from "global" log list */
|
||||||
@ -1078,14 +1077,12 @@ static int httpclient_cfg_postparser()
|
|||||||
LIST_APPEND(&curproxy->logsrvs, &node->list);
|
LIST_APPEND(&curproxy->logsrvs, &node->list);
|
||||||
}
|
}
|
||||||
if (curproxy->conf.logformat_string) {
|
if (curproxy->conf.logformat_string) {
|
||||||
char *err = NULL;
|
|
||||||
|
|
||||||
curproxy->conf.args.ctx = ARGC_LOG;
|
curproxy->conf.args.ctx = ARGC_LOG;
|
||||||
if (!parse_logformat_string(curproxy->conf.logformat_string, curproxy, &curproxy->logformat,
|
if (!parse_logformat_string(curproxy->conf.logformat_string, curproxy, &curproxy->logformat,
|
||||||
LOG_OPT_MANDATORY|LOG_OPT_MERGE_SPACES,
|
LOG_OPT_MANDATORY|LOG_OPT_MERGE_SPACES,
|
||||||
SMP_VAL_FE_LOG_END, &err)) {
|
SMP_VAL_FE_LOG_END, &errmsg)) {
|
||||||
ha_alert("httpclient: failed to parse log-format : %s.\n", err);
|
ha_alert("httpclient: failed to parse log-format : %s.\n", errmsg);
|
||||||
free(err);
|
free(errmsg);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
curproxy->conf.args.file = NULL;
|
curproxy->conf.args.file = NULL;
|
||||||
@ -1093,14 +1090,18 @@ static int httpclient_cfg_postparser()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
/* init the SNI expression */
|
{
|
||||||
/* always use the host header as SNI, without the port */
|
int err_code = 0;
|
||||||
httpclient_srv_ssl->sni_expr = strdup("req.hdr(host),field(1,:)");
|
|
||||||
err_code |= server_parse_sni_expr(httpclient_srv_ssl, httpclient_proxy, &errmsg);
|
/* init the SNI expression */
|
||||||
if (err_code & ERR_CODE) {
|
/* always use the host header as SNI, without the port */
|
||||||
ha_alert("httpclient: failed to configure sni: %s.\n", errmsg);
|
httpclient_srv_ssl->sni_expr = strdup("req.hdr(host),field(1,:)");
|
||||||
free(errmsg);
|
err_code |= server_parse_sni_expr(httpclient_srv_ssl, httpclient_proxy, &errmsg);
|
||||||
goto err;
|
if (err_code & ERR_CODE) {
|
||||||
|
ha_alert("httpclient: failed to configure sni: %s.\n", errmsg);
|
||||||
|
free(errmsg);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user