summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_go.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-07-05 13:31:45 +0300
committerMax Romanov <max.romanov@nginx.com>2017-07-05 13:31:45 +0300
commitf3107f3896c199a5bc166f57ccd9fef2823ccdaf (patch)
tree1bb2388940d3ad1be08ababfecd270c65289cf26 /src/nxt_go.c
parentf05d674126f3ec3f147f645231a1357e4a0784bf (diff)
downloadunit-f3107f3896c199a5bc166f57ccd9fef2823ccdaf.tar.gz
unit-f3107f3896c199a5bc166f57ccd9fef2823ccdaf.tar.bz2
Complex target parser copied from NGINX.
nxt_app_request_header_t fields renamed: - 'path' renamed to 'target'. - 'path_no_query' renamed to 'path' and contains parsed value.
Diffstat (limited to '')
-rw-r--r--src/nxt_go.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nxt_go.c b/src/nxt_go.c
index 703974ba..4c77de0d 100644
--- a/src/nxt_go.c
+++ b/src/nxt_go.c
@@ -158,11 +158,16 @@ nxt_go_prepare_msg(nxt_task_t *task, nxt_app_request_t *r, nxt_app_wmsg_t *wmsg)
/* TODO error handle, async mmap buffer assignment */
NXT_WRITE(&h->method);
- NXT_WRITE(&h->path);
+ NXT_WRITE(&h->target);
+ if (h->path.start == h->target.start) {
+ NXT_WRITE(&eof);
+ } else {
+ NXT_WRITE(&h->path);
+ }
if (h->query.start != NULL) {
RC(nxt_app_msg_write_size(task, wmsg,
- h->query.start - h->path.start + 1));
+ h->query.start - h->target.start + 1));
} else {
RC(nxt_app_msg_write_size(task, wmsg, 0));
}