View | Details | Raw Unified | Return to bug 207196
Collapse All | Expand All

(-)www/uwsgi/files/patch-2483e64.diff (+61 lines)
Line 0 Link Here
1
commit 2483e64e6dd504af5eefd4da94fc57c0f83b2563
2
Author: Joerg Sonnenberger <joerg@NetBSD.org>
3
Date:   Wed Jan 13 17:00:53 2016 +0100
4
5
    plugins: properly update loop indexes once
6
    
7
    Fix clang warning about changing the loop variable in both loop
8
    body and header
9
10
diff --git plugins/cgi/cgi_plugin.c plugins/cgi/cgi_plugin.c
11
index e4fe6e6..340886a 100644
12
--- plugins/cgi/cgi_plugin.c
13
+++ plugins/cgi/cgi_plugin.c
14
@@ -763,12 +763,11 @@ clear2:
15
 	}
16
 
17
 	// fill cgi env
18
-	for(i=0;i<wsgi_req->var_cnt;i++) {
19
+	for(i=0;i<wsgi_req->var_cnt;i+=2) {
20
 		// no need to free the putenv() memory
21
 		if (putenv(uwsgi_concat3n(wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len, "=", 1, wsgi_req->hvec[i+1].iov_base, wsgi_req->hvec[i+1].iov_len))) {
22
 			uwsgi_error("putenv()");
23
 		}
24
-		i++;
25
 	}
26
 
27
 
28
diff --git plugins/gccgo/gccgo_plugin.c plugins/gccgo/gccgo_plugin.c
29
index 09cfd69..98d8f71 100644
30
--- plugins/gccgo/gccgo_plugin.c
31
+++ plugins/gccgo/gccgo_plugin.c
32
@@ -233,9 +233,8 @@ static int uwsgi_gccgo_request(struct wsgi_request *wsgi_req) {
33
 
34
 	wsgi_req->async_environ = uwsgigo_env(wsgi_req);
35
 	int i;
36
-        for(i=0;i<wsgi_req->var_cnt;i++) {
37
+        for(i=0;i<wsgi_req->var_cnt;i+=2) {
38
                 uwsgigo_env_add(wsgi_req->async_environ, wsgi_req->hvec[i].iov_base,  wsgi_req->hvec[i].iov_len, wsgi_req->hvec[i+1].iov_base, wsgi_req->hvec[i+1].iov_len);
39
-                i++;
40
         }
41
 	uwsgigo_request(wsgi_req->async_environ, wsgi_req);
42
 end:
43
diff --git plugins/jwsgi/jwsgi_plugin.c plugins/jwsgi/jwsgi_plugin.c
44
index 8cdac16..3b98632 100644
45
--- plugins/jwsgi/jwsgi_plugin.c
46
+++ plugins/jwsgi/jwsgi_plugin.c
47
@@ -71,13 +71,12 @@ static int uwsgi_jwsgi_request(struct wsgi_request *wsgi_req) {
48
 	if (!hm) return -1;
49
 
50
 	int i;
51
-	for(i=0;i<wsgi_req->var_cnt;i++) {
52
+	for(i=0;i<wsgi_req->var_cnt;i+=2) {
53
                 char *hk = wsgi_req->hvec[i].iov_base;
54
                 uint16_t hk_l = wsgi_req->hvec[i].iov_len;
55
                 char *hv = wsgi_req->hvec[i+1].iov_base;
56
                 uint16_t hv_l = wsgi_req->hvec[i+1].iov_len;
57
 		if (uwsgi_jwsgi_add_request_item(hm, hk, hk_l, hv, hv_l)) goto end;
58
-		i++;
59
 	}
60
 
61
 	if (uwsgi_jwsgi_add_request_input(hm, "jwsgi.input", 11)) goto end;

Return to bug 207196