forked from AlexWoo/nginx-multiport-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngx_multiport.h
53 lines (41 loc) · 1.34 KB
/
ngx_multiport.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
48
49
50
51
52
53
/*
* Copyright (C) AlexWoo(Wu Jie) wj19840501@gmail.com
*/
#ifndef _NGX_MULTIPORT_H_INCLUDED_
#define _NGX_MULTIPORT_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
/*
* return value:
* NGX_OK for success, NGX_ERROR for failed
* paras:
* pool: pool for port memory alloc
* port: process real listen port while process_slot is pslot
* multiport: port configure for processes, format as below:
* port only: port
* IPv4: host:port host must be ipaddr of IPv4 or *
* IPv6: [host]:port host must be ipaddr of IPv6
* Unix: unix:/path
* pslot: process_slot
*/
ngx_int_t ngx_multiport_get_port(ngx_pool_t *pool, ngx_str_t *port,
ngx_str_t *multiport, ngx_int_t pslot);
/*
* return value:
* ngx_process_slot for successd, NGX_ERROR for failed
* paras:
* wpid: worker process id, 0 to ccf->worker_processes - 1
*/
ngx_int_t ngx_multiport_get_slot(ngx_uint_t wpid);
/*
* return value:
* NGX_OK : for successd
* NGX_ERROR : for failed
* NGX_DECLINED: for not configured or send inner proxy to self
* paras:
* r : http request for send inner request to sibling worker
* pslot: sibling worker ngx_process_slot
*/
ngx_int_t ngx_http_inner_proxy_request(ngx_http_request_t *r, ngx_int_t pslot);
#endif