Skip to content

Commit e80bb14

Browse files
committed
Fixing compilation with nginx>=1.9.1
1 parent 49855a0 commit e80bb14

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ngx_postgres_util.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,18 @@ ngx_postgres_upstream_finalize_request(ngx_http_request_t *r,
6161
u->resolved->ctx = NULL;
6262
}
6363

64+
#if defined(nginx_version) && (nginx_version >= 1009001)
65+
if (u->state && u->state->response_time) {
66+
#else
6467
if (u->state && u->state->response_sec) {
68+
#endif
6569
tp = ngx_timeofday();
70+
#if defined(nginx_version) && (nginx_version >= 1009001)
71+
u->state->response_time = tp->msec - u->state->response_time;
72+
#else
6673
u->state->response_sec = tp->sec - u->state->response_sec;
6774
u->state->response_msec = tp->msec - u->state->response_msec;
75+
#endif
6876

6977
if (u->pipe) {
7078
u->state->response_length = u->pipe->read_length;

0 commit comments

Comments
 (0)