summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_php_sapi.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-09-07 16:39:31 -0700
committerMax Romanov <max.romanov@nginx.com>2017-09-07 16:39:31 -0700
commitd87a4fb642ed4588483e65cd74a83b0cec7e8d29 (patch)
tree0758fc192846bdbe7edc12ddfcdc1d665ff70415 /src/nxt_php_sapi.c
parent789a101e99433ea371f7560758a5130a97d129a1 (diff)
downloadunit-d87a4fb642ed4588483e65cd74a83b0cec7e8d29.tar.gz
unit-d87a4fb642ed4588483e65cd74a83b0cec7e8d29.tar.bz2
Moving body data before headers for PHP POST.
PHP SAPI tries to read body for POST request before registering header-specific variables. For other methods, read_post_body() called by SAPI after variables registration. This closes #10 issue on GitHub.
Diffstat (limited to '')
-rw-r--r--src/nxt_php_sapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c
index ba7a5aad..c60a8dab 100644
--- a/src/nxt_php_sapi.c
+++ b/src/nxt_php_sapi.c
@@ -333,6 +333,8 @@ nxt_php_read_request(nxt_task_t *task, nxt_app_rmsg_t *rmsg,
RC(nxt_app_msg_read_size(task, rmsg, &s));
h->parsed_content_length = s;
+ RC(nxt_app_msg_read_size(task, ctx->rmsg, &ctx->body_preread_size));
+
#undef NXT_READ
#undef RC
@@ -741,8 +743,6 @@ nxt_php_register_variables(zval *track_vars_array TSRMLS_DC)
NXT_PHP_SET(n.start, v);
}
- nxt_app_msg_read_size(task, ctx->rmsg, &ctx->body_preread_size);
-
#undef NXT_PHP_SET
}