Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ngx_http_proxy_upstream.c « proxy « modules « http « src - github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 532e313d60ead398ae51a5dea5c29950189b3000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include <ngx_event_connect.h>
#include <ngx_event_pipe.h>
#include <ngx_http.h>
#include <ngx_http_proxy_handler.h>


void ngx_http_proxy_reinit_upstream(ngx_http_proxy_ctx_t *p)
{
    ngx_chain_t             *cl;
    ngx_output_chain_ctx_t  *octx;

    octx = p->output_chain_ctx;

    /* reinit the request chain */

    for (cl = p->request->request_hunks; cl; cl = cl->next) {
        cl->hunk->pos = cl->hunk->start;
    }

    /* reinit ngx_output_chain() context */

    octx->hunk = NULL;
    octx->in = NULL;
    octx->free = NULL;
    octx->busy = NULL;

    /* reinit r->header_in buffer */

    if (p->header_in) {
        if (p->cache) {
            p->header_in->pos = p->header_in->start + p->cache->ctx.header.size;
            p->header_in->last = p->header_in->pos;

        } else {
            p->header_in->pos = p->header_in->start;
            p->header_in->last = p->header_in->start;
        }
    }
}