summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-06-01 17:25:36 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-06-01 17:25:36 +0000
commit1089957488f68c4b60c9c2fb7faecee85e8598f4 (patch)
tree22e43a76e0715e0b6c50771cf24ea03c3d728a91 /src
parent4c9c518bbf97dd6b445a399cb0ea9f2cf55b8ae1 (diff)
downloadnginx-1089957488f68c4b60c9c2fb7faecee85e8598f4.tar.gz
nginx-1089957488f68c4b60c9c2fb7faecee85e8598f4.tar.bz2
remove useless copy: key name should be just copied before value length
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_uwsgi_module.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
index 42a169e61..94feee354 100644
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -451,7 +451,7 @@ ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)
static ngx_int_t
ngx_http_uwsgi_create_request(ngx_http_request_t *r)
{
- u_char ch, *pos, tmp[2];
+ u_char ch;
size_t key_len, val_len, len;
ngx_uint_t i, n;
ngx_buf_t *b;
@@ -564,25 +564,17 @@ ngx_http_uwsgi_create_request(ngx_http_request_t *r)
*e.pos++ = (u_char) (key_len & 0xff);
*e.pos++ = (u_char) ((key_len >> 8) & 0xff);
+ code = *(ngx_http_script_code_pt *) e.ip;
+ code((ngx_http_script_engine_t *) & e);
+
+ *e.pos++ = (u_char) (val_len & 0xff);
+ *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
+
while (*(uintptr_t *) e.ip) {
code = *(ngx_http_script_code_pt *) e.ip;
code((ngx_http_script_engine_t *) & e);
}
- pos = e.pos - val_len;
- /* move memory */
- for (i = 0; i < val_len; i += 2) {
- e.pos = ngx_cpymem(tmp, pos + i + 2, 2);
- e.pos = ngx_cpymem(pos + i + 2, pos, 2);
- e.pos = ngx_cpymem(pos, tmp, 2);
- }
-
- e.pos = pos;
-
- *e.pos++ = (u_char) (val_len & 0xff);
- *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
- e.pos += val_len;
-
e.ip += sizeof(uintptr_t);
}