From f3107f3896c199a5bc166f57ccd9fef2823ccdaf Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 5 Jul 2017 13:31:45 +0300 Subject: 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. --- src/nginext/nxt_go_port.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/nginext') diff --git a/src/nginext/nxt_go_port.c b/src/nginext/nxt_go_port.c index 00d13a38..47e46f02 100644 --- a/src/nginext/nxt_go_port.c +++ b/src/nginext/nxt_go_port.c @@ -41,22 +41,27 @@ nxt_go_data_handler(nxt_port_msg_t *port_msg, size_t size) h = &ctx->r.header; nxt_go_ctx_read_str(ctx, &h->method); + nxt_go_ctx_read_str(ctx, &h->target); nxt_go_ctx_read_str(ctx, &h->path); - h->path_no_query = h->path; nxt_go_ctx_read_size(ctx, &s); if (s > 0) { s--; - h->query.start = h->path.start + s; - h->query.length = h->path.length - s; + h->query.start = h->target.start + s; + h->query.length = h->target.length - s; - if (s > 0) { - h->path_no_query.length = s - 1; + if (h->path.start == NULL) { + h->path.start = h->target.start; + h->path.length = s - 1; } } + if (h->path.start == NULL) { + h->path = h->target; + } + nxt_go_new_request(r, port_msg->stream, nxt_go_str(&h->method), - nxt_go_str(&h->path)); + nxt_go_str(&h->target)); nxt_go_ctx_read_str(ctx, &h->version); -- cgit