forked from AlexWoo/nginx-rtmp-module
-
Notifications
You must be signed in to change notification settings - Fork 42
/
ngx_netcall.h
47 lines (30 loc) · 1.19 KB
/
ngx_netcall.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
40
41
42
43
44
45
46
47
/*
* Copyright (C) AlexWoo(Wu Jie) [email protected]
*/
#ifndef _NGX_NETCALL_H_INCLUDE_
#define _NGX_NETCALL_H_INCLUDE_
#include <ngx_core.h>
#include "ngx_http_client.h"
#define NGX_NETCALL_MAX_URL_LEN 2048
typedef struct ngx_netcall_ctx_s ngx_netcall_ctx_t;
typedef void (* ngx_netcall_handler_pt)(ngx_netcall_ctx_t *ctx, ngx_int_t code);
struct ngx_netcall_ctx_s {
ngx_pool_t *pool;
ngx_str_t url;
ngx_uint_t idx;
ngx_uint_t type;
ngx_str_t groupid;
ngx_uint_t stage;
ngx_msec_t timeout;
ngx_msec_t update;
ngx_event_t ev;
ngx_http_request_t *hcr;
ngx_netcall_handler_pt handler;
void *data;
};
ngx_netcall_ctx_t *ngx_netcall_create_ctx(ngx_uint_t type, ngx_str_t *groupid,
ngx_uint_t stage, ngx_msec_t timeout, ngx_msec_t update, ngx_uint_t idx);
void ngx_netcall_create(ngx_netcall_ctx_t *nctx, ngx_log_t *log);
void ngx_netcall_destroy(ngx_netcall_ctx_t *nctx);
ngx_str_t *ngx_netcall_header(ngx_netcall_ctx_t *nctx, ngx_str_t *key);
#endif