Skip to content

Commit ad6a835

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ngx_postgres_util.c

+7
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,17 @@ 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+
u->state->response_time = ngx_timeofday()->msec - u->state->response_time;
67+
68+
#else
69+
6470
if (u->state && u->state->response_sec) {
6571
tp = ngx_timeofday();
6672
u->state->response_sec = tp->sec - u->state->response_sec;
6773
u->state->response_msec = tp->msec - u->state->response_msec;
74+
#endif
6875

6976
if (u->pipe) {
7077
u->state->response_length = u->pipe->read_length;

0 commit comments

Comments
 (0)