forked from kaltura/nginx-vod-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ngx_child_http_request.h
39 lines (32 loc) · 1.19 KB
/
ngx_child_http_request.h
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
#ifndef _NGX_CHILD_HTTP_REQUEST_INCLUDED_
#define _NGX_CHILD_HTTP_REQUEST_INCLUDED_
// includes
#include <ngx_http.h>
// typedefs
typedef void(*ngx_child_request_callback_t)(void* context, ngx_int_t rc, ngx_buf_t* buf, ssize_t bytes_read);
typedef struct {
ngx_uint_t method;
ngx_str_t base_uri;
ngx_str_t extra_args;
off_t range_start;
off_t range_end;
ngx_table_elt_t extra_header;
ngx_flag_t proxy_range;
ngx_flag_t proxy_accept_encoding;
} ngx_child_request_params_t;
// functions
// Notes:
// 1. callback is optional, if it is not supplied, the module will finalize the request
// when the upstream request completes.
// 2. response_buffer is optional, if it is not supplied, the upstream response gets written
// to the parent request. when a response buffer is supplied, the response is written to it,
// the buffer should be large enough to contain both the response body and the response headers.
ngx_int_t ngx_child_request_start(
ngx_http_request_t *r,
ngx_child_request_callback_t callback,
void* callback_context,
ngx_str_t* internal_location,
ngx_child_request_params_t* params,
ngx_buf_t* response_buffer);
void ngx_child_request_init();
#endif // _NGX_CHILD_HTTP_REQUEST_INCLUDED_