-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathjvm_route.patch
115 lines (101 loc) · 3.88 KB
/
jvm_route.patch
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
diff -Bbu -Bbu -ur ./src/http/ngx_http_upstream.c ../nginx-1.15.0-upstream-jvm-route-pached/src/http/ngx_http_upstream.c
--- ./src/http/ngx_http_upstream.c 2018-06-05 09:47:25.000000000 -0400
+++ ../nginx-1.15.0-upstream-jvm-route-pached/src/http/ngx_http_upstream.c 2018-06-20 13:28:14.000000000 -0400
@@ -5657,6 +5657,8 @@
|NGX_HTTP_UPSTREAM_MAX_CONNS
|NGX_HTTP_UPSTREAM_MAX_FAILS
|NGX_HTTP_UPSTREAM_FAIL_TIMEOUT
+ |NGX_HTTP_UPSTREAM_SRUN_ID
+ |NGX_HTTP_UPSTREAM_MAX_BUSY
|NGX_HTTP_UPSTREAM_DOWN
|NGX_HTTP_UPSTREAM_BACKUP);
if (uscf == NULL) {
@@ -5754,9 +5756,9 @@
ngx_http_upstream_srv_conf_t *uscf = conf;
time_t fail_timeout;
- ngx_str_t *value, s;
+ ngx_str_t *value, s, id;
ngx_url_t u;
- ngx_int_t weight, max_conns, max_fails;
+ ngx_int_t weight, max_conns, max_fails, max_busy;
ngx_uint_t i;
ngx_http_upstream_server_t *us;
@@ -5772,7 +5774,10 @@
weight = 1;
max_conns = 0;
max_fails = 1;
+ max_busy = 0;
fail_timeout = 10;
+ id.data = (u_char *) "a";
+ id.len = sizeof("a") - 1;
for (i = 2; i < cf->args->nelts; i++) {
@@ -5821,6 +5826,21 @@
continue;
}
+ if (ngx_strncmp(value[i].data, "max_busy=", 9) == 0) {
+
+ if (!(uscf->flags & NGX_HTTP_UPSTREAM_MAX_BUSY)) {
+ goto invalid;
+ }
+
+ max_busy = ngx_atoi(&value[i].data[9], value[i].len - 9);
+
+ if (max_busy == NGX_ERROR) {
+ goto invalid;
+ }
+
+ continue;
+ }
+
if (ngx_strncmp(value[i].data, "fail_timeout=", 13) == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_FAIL_TIMEOUT)) {
@@ -5839,6 +5859,23 @@
continue;
}
+ if (ngx_strncmp(value[i].data, "srun_id=", 8) == 0) {
+
+ if (!(uscf->flags & NGX_HTTP_UPSTREAM_SRUN_ID)) {
+ goto invalid;
+ }
+
+ id.len = value[i].len - 8;
+ id.data = &value[i].data[8];
+
+ if (id.len == 0) {
+ goto invalid;
+ }
+
+ continue;
+ }
+
+
if (ngx_strcmp(value[i].data, "backup") == 0) {
if (!(uscf->flags & NGX_HTTP_UPSTREAM_BACKUP)) {
@@ -5884,7 +5921,9 @@
us->weight = weight;
us->max_conns = max_conns;
us->max_fails = max_fails;
+ us->max_busy = max_busy;
us->fail_timeout = fail_timeout;
+ us->srun_id = id;
return NGX_CONF_OK;
Only in ../nginx-1.15.0-upstream-jvm-route-pached/src/http: ngx_http_upstream.c.orig
diff -Bbu -Bbu -ur ./src/http/ngx_http_upstream.h ../nginx-1.15.0-upstream-jvm-route-pached/src/http/ngx_http_upstream.h
--- ./src/http/ngx_http_upstream.h 2018-06-05 09:47:25.000000000 -0400
+++ ../nginx-1.15.0-upstream-jvm-route-pached/src/http/ngx_http_upstream.h 2018-06-20 13:29:36.000000000 -0400
@@ -101,6 +101,9 @@
ngx_msec_t slow_start;
ngx_uint_t down;
+ ngx_uint_t max_busy;
+ ngx_str_t srun_id;
+
unsigned backup:1;
NGX_COMPAT_BEGIN(6)
@@ -115,6 +118,8 @@
#define NGX_HTTP_UPSTREAM_DOWN 0x0010
#define NGX_HTTP_UPSTREAM_BACKUP 0x0020
#define NGX_HTTP_UPSTREAM_MAX_CONNS 0x0100
+#define NGX_HTTP_UPSTREAM_SRUN_ID 0x0040
+#define NGX_HTTP_UPSTREAM_MAX_BUSY 0x0080
struct ngx_http_upstream_srv_conf_s {
Only in ../nginx-1.15.0-upstream-jvm-route-pached/src/http: ngx_http_upstream.h.orig