-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngx_http_upstream_log_1.25.3+.patch
39 lines (34 loc) · 1.08 KB
/
ngx_http_upstream_log_1.25.3+.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
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 2be233c..e52a78f 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -9,6 +9,10 @@
#include <ngx_core.h>
#include <ngx_http.h>
+#if (NGX_HTTP_UPSTREAM_LOG)
+#include "ngx_http_upstream_log_module.h"
+#endif
+
#if (NGX_HTTP_CACHE)
static ngx_int_t ngx_http_upstream_cache(ngx_http_request_t *r,
@@ -1542,6 +1546,11 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u)
if (u->state && u->state->response_time == (ngx_msec_t) -1) {
u->state->response_time = ngx_current_msec - u->start_time;
+
+#if (NGX_HTTP_UPSTREAM_LOG)
+ ngx_http_upstream_log_handler(r);
+#endif
+
}
u->state = ngx_array_push(r->upstream_states);
@@ -4531,6 +4567,11 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
if (u->peer.connection) {
u->state->bytes_sent = u->peer.connection->sent;
}
+
+#if (NGX_HTTP_UPSTREAM_LOG)
+ ngx_http_upstream_log_handler(r);
+#endif
+
}
u->finalize_request(r, rc);