Skip to content

Commit

Permalink
plugins: properly update loop indexes once
Browse files Browse the repository at this point in the history
Fix clang warning about changing the loop variable in both loop
body and header
  • Loading branch information
jsonn authored and xrmx committed Jan 13, 2016
1 parent a1f68db commit 2483e64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions plugins/cgi/cgi_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,11 @@ static int uwsgi_cgi_run(struct wsgi_request *wsgi_req, char *docroot, size_t do
}

// fill cgi env
for(i=0;i<wsgi_req->var_cnt;i++) {
for(i=0;i<wsgi_req->var_cnt;i+=2) {
// no need to free the putenv() memory
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))) {
uwsgi_error("putenv()");
}
i++;
}


Expand Down
3 changes: 1 addition & 2 deletions plugins/gccgo/gccgo_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ static int uwsgi_gccgo_request(struct wsgi_request *wsgi_req) {

wsgi_req->async_environ = uwsgigo_env(wsgi_req);
int i;
for(i=0;i<wsgi_req->var_cnt;i++) {
for(i=0;i<wsgi_req->var_cnt;i+=2) {
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);
i++;
}
uwsgigo_request(wsgi_req->async_environ, wsgi_req);
end:
Expand Down
3 changes: 1 addition & 2 deletions plugins/jwsgi/jwsgi_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ static int uwsgi_jwsgi_request(struct wsgi_request *wsgi_req) {
if (!hm) return -1;

int i;
for(i=0;i<wsgi_req->var_cnt;i++) {
for(i=0;i<wsgi_req->var_cnt;i+=2) {
char *hk = wsgi_req->hvec[i].iov_base;
uint16_t hk_l = wsgi_req->hvec[i].iov_len;
char *hv = wsgi_req->hvec[i+1].iov_base;
uint16_t hv_l = wsgi_req->hvec[i+1].iov_len;
if (uwsgi_jwsgi_add_request_item(hm, hk, hk_l, hv, hv_l)) goto end;
i++;
}

if (uwsgi_jwsgi_add_request_input(hm, "jwsgi.input", 11)) goto end;
Expand Down

0 comments on commit 2483e64

Please sign in to comment.