Hello,

src/mux_h2.c:5939:3: warning: Value stored to 'count' is never read
                count = 0;

src/ssl_sock.c:6650:6: warning: Value stored to 'ret' is never read
                                        ret = 1;

src/ssl_sock.c:9428:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:9483:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:9742:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:9803:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:11464:3: warning: Value stored to 'cfgerr' is never read
                cfgerr |= ERR_ALERT | ERR_FATAL;

src/ssl_sock.c:11489:4: warning: Value stored to 'cfgerr' is never read
                        cfgerr |= ERR_ALERT | ERR_FATAL;

src/cfgparse-listen.c:608:6: warning: Value stored to 'cur_arg' is never
read
                                        cur_arg += 1 + kw->skip ;

src/cfgparse-listen.c:629:7: warning: Value stored to 'cur_arg' is never
read
                                                cur_arg += 1 + kw->skip;

src/http_ana.c:3292:6: warning: Value stored to 'val_end' is never read
                                        val_end  += delta;

src/http_ana.c:3295:6: warning: Value stored to 'prev' is never read
                                        prev     = del_from;

src/http_ana.c:3502:6: warning: Value stored to 'val_end' is never read
                                        val_end  += delta;

src/http_ana.c:3523:7: warning: Value stored to 'att_beg' is never read
                                                att_beg += delta;

src/http_ana.c:3525:7: warning: Value stored to 'att_end' is never read
                                                att_end += delta;

src/http_ana.c:3526:6: warning: Value stored to 'val_beg' is never read
                                        val_beg  += delta;

src/http_ana.c:3527:6: warning: Value stored to 'val_end' is never read
                                        val_end  += delta;

src/http_ana.c:3530:6: warning: Value stored to 'prev' is never read
                                        prev     = del_from;

src/http_ana.c:3536:4: warning: Value stored to 'att_beg' is never read
                        att_beg = next;

src/http_ana.c:3808:6: warning: Value stored to 'val_beg' is never read
                                        val_beg  += sliding;

src/acl.c:958:4: warning: Value stored to 'word' is never read
                        word = args[arg + 1];



Cheers,
Ilya Shipitcin
From f8a3802bdd6efbd9c064f4276a6412980f60b8c9 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <chipits...@gmail.com>
Date: Thu, 23 Apr 2020 14:19:01 +0500
Subject: [PATCH] CLEANUP: remove variables that are not used anymore

src/mux_h2.c:5939:3: warning: Value stored to 'count' is never read
                count = 0;

src/ssl_sock.c:6650:6: warning: Value stored to 'ret' is never read
                                        ret = 1;

src/ssl_sock.c:9428:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:9483:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:9742:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:9803:2: warning: Value stored to 'p2' is never read
        p2 = p1 + 1;

src/ssl_sock.c:11464:3: warning: Value stored to 'cfgerr' is never read
                cfgerr |= ERR_ALERT | ERR_FATAL;

src/ssl_sock.c:11489:4: warning: Value stored to 'cfgerr' is never read
                        cfgerr |= ERR_ALERT | ERR_FATAL;

src/cfgparse-listen.c:608:6: warning: Value stored to 'cur_arg' is never read
                                        cur_arg += 1 + kw->skip ;

src/cfgparse-listen.c:629:7: warning: Value stored to 'cur_arg' is never read
                                                cur_arg += 1 + kw->skip;

src/http_ana.c:3292:6: warning: Value stored to 'val_end' is never read
                                        val_end  += delta;

src/http_ana.c:3295:6: warning: Value stored to 'prev' is never read
                                        prev     = del_from;

src/http_ana.c:3502:6: warning: Value stored to 'val_end' is never read
                                        val_end  += delta;

src/http_ana.c:3523:7: warning: Value stored to 'att_beg' is never read
                                                att_beg += delta;

src/http_ana.c:3525:7: warning: Value stored to 'att_end' is never read
                                                att_end += delta;

src/http_ana.c:3526:6: warning: Value stored to 'val_beg' is never read
                                        val_beg  += delta;

src/http_ana.c:3527:6: warning: Value stored to 'val_end' is never read
                                        val_end  += delta;

src/http_ana.c:3530:6: warning: Value stored to 'prev' is never read
                                        prev     = del_from;

src/http_ana.c:3536:4: warning: Value stored to 'att_beg' is never read
                        att_beg = next;

src/http_ana.c:3808:6: warning: Value stored to 'val_beg' is never read
                                        val_beg  += sliding;

src/acl.c:958:4: warning: Value stored to 'word' is never read
                        word = args[arg + 1];
---
 src/acl.c             |  1 -
 src/cfgparse-listen.c |  2 --
 src/http_ana.c        | 13 -------------
 src/mux_h2.c          |  1 -
 src/ssl_sock.c        | 11 ++---------
 5 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/src/acl.c b/src/acl.c
index f3d7af789..fa8ae9238 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -955,7 +955,6 @@ struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl,
 				/* note that parse_acl() must have filled <err> here */
 				goto out_free_suite;
 			}
-			word = args[arg + 1];
 			arg = arg_end;
 		}
 		else {
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 7ebd2d513..015783afe 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -605,7 +605,6 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 				if (!kw->parse) {
 					ha_alert("parsing [%s:%d] : '%s %s' : '%s' option is not implemented in this version (check build options).\n",
 						 file, linenum, args[0], args[1], args[cur_arg]);
-					cur_arg += 1 + kw->skip ;
 					err_code |= ERR_ALERT | ERR_FATAL;
 					goto out;
 				}
@@ -626,7 +625,6 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 							 file, linenum, args[0], args[1], args[cur_arg]);
 					if (code & ERR_FATAL) {
 						free(err);
-						cur_arg += 1 + kw->skip;
 						goto out;
 					}
 				}
diff --git a/src/http_ana.c b/src/http_ana.c
index e0fe67e24..336b8b658 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -3289,10 +3289,8 @@ static void http_manage_client_side_cookies(struct stream *s, struct channel *re
 				preserve_hdr = 1;
 				if (del_from != NULL) {
 					int delta = http_del_hdr_value(hdr_beg, hdr_end, &del_from, prev);
-					val_end  += delta;
 					next     += delta;
 					hdr_end  += delta;
-					prev     = del_from;
 					del_from = NULL;
 				}
 				continue;
@@ -3499,7 +3497,6 @@ static void http_manage_client_side_cookies(struct stream *s, struct channel *re
 
 					memmove(val_beg, delim + 1, hdr_end - (delim + 1));
 					delta = val_beg - (delim + 1);
-					val_end  += delta;
 					next     += delta;
 					hdr_end  += delta;
 					del_from = NULL;
@@ -3519,21 +3516,12 @@ static void http_manage_client_side_cookies(struct stream *s, struct channel *re
 
 				if (del_from != NULL) {
 					int delta = http_del_hdr_value(hdr_beg, hdr_end, &del_from, prev);
-					if (att_beg >= del_from)
-						att_beg += delta;
-					if (att_end >= del_from)
-						att_end += delta;
-					val_beg  += delta;
-					val_end  += delta;
 					next     += delta;
 					hdr_end  += delta;
-					prev     = del_from;
 					del_from = NULL;
 				}
 			}
 
-			/* continue with next cookie on this header line */
-			att_beg = next;
 		} /* for each cookie */
 
 
@@ -3805,7 +3793,6 @@ static void http_manage_server_side_cookies(struct stream *s, struct channel *re
 					delta     = srv->cklen - (val_end - val_beg);
 					sliding   = (ctx.value.ptr - val_beg);
 					hdr_beg  += sliding;
-					val_beg  += sliding;
 					next     += sliding + delta;
 					hdr_end  += sliding + delta;
 
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 6b1c0d118..e473d037c 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -5936,7 +5936,6 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
 		 * unprocessed trailers, abnormal extra data, ...)
 		 */
 		total += count;
-		count = 0;
 	}
 
 	/* RST are sent similarly to frame acks */
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 12b40123d..e04a8a60a 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -6646,10 +6646,9 @@ static int ssl_sock_handshake(struct connection *conn, unsigned int flag)
 				/* handshake may have been completed but we have
 				 * no more data to read.
                                  */
-				if (!SSL_renegotiate_pending(ctx->ssl)) {
-					ret = 1;
+				if (!SSL_renegotiate_pending(ctx->ssl))
 					goto reneg_ok;
-				}
+
 				/* SSL handshake needs to read, L4 connection is ready */
 				if (!(ctx->wait_event.events & SUB_RETRY_RECV))
 					ctx->xprt->subscribe(conn, ctx->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event);
@@ -9425,7 +9424,6 @@ static int ssl_bind_parse_npn(char **args, int cur_arg, struct proxy *px, struct
 
 	/* replace commas with the name length */
 	p1 = conf->npn_str;
-	p2 = p1 + 1;
 	while (1) {
 		p2 = memchr(p1 + 1, ',', conf->npn_str + conf->npn_len - (p1 + 1));
 		if (!p2)
@@ -9480,7 +9478,6 @@ static int ssl_bind_parse_alpn(char **args, int cur_arg, struct proxy *px, struc
 
 	/* replace commas with the name length */
 	p1 = conf->alpn_str;
-	p2 = p1 + 1;
 	while (1) {
 		p2 = memchr(p1 + 1, ',', conf->alpn_str + conf->alpn_len - (p1 + 1));
 		if (!p2)
@@ -9739,7 +9736,6 @@ static int srv_parse_npn(char **args, int *cur_arg, struct proxy *px, struct ser
 
 	/* replace commas with the name length */
 	p1 = newsrv->ssl_ctx.npn_str;
-	p2 = p1 + 1;
 	while (1) {
 		p2 = memchr(p1 + 1, ',', newsrv->ssl_ctx.npn_str +
 		    newsrv->ssl_ctx.npn_len - (p1 + 1));
@@ -9800,7 +9796,6 @@ static int srv_parse_alpn(char **args, int *cur_arg, struct proxy *px, struct se
 
 	/* replace commas with the name length */
 	p1 = *alpn_str;
-	p2 = p1 + 1;
 	while (1) {
 		p2 = memchr(p1 + 1, ',', *alpn_str + *alpn_len - (p1 + 1));
 		if (!p2)
@@ -11461,7 +11456,6 @@ static int cli_parse_add_crtlist(char **args, char *payload, struct appctx *appc
 
 	if (!cert_path) {
 		memprintf(&err, "'add ssl crtlist' should contain the certificate name in the payload");
-		cfgerr |= ERR_ALERT | ERR_FATAL;
 		goto error;
 	}
 
@@ -11486,7 +11480,6 @@ static int cli_parse_add_crtlist(char **args, char *payload, struct appctx *appc
 	if (*cert_path != '/' && global_ssl.crt_base) {
 		if ((strlen(global_ssl.crt_base) + 1 + strlen(cert_path)) > MAXPATHLEN) {
 			memprintf(&err, "'%s' : path too long", cert_path);
-			cfgerr |= ERR_ALERT | ERR_FATAL;
 			goto error;
 		}
 		snprintf(path, sizeof(path), "%s/%s",  global_ssl.crt_base, cert_path);
-- 
2.25.3

Reply via email to