Skip to content

Commit

Permalink
Compatibility: added response_time for the nginx v1.9.1(http://hg.ngi…
Browse files Browse the repository at this point in the history
  • Loading branch information
vozlt committed May 19, 2015
1 parent 5548b2d commit 3822810
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ Nginx virtual host traffic status module
* [nginx](http://nginx.org)

## Compatibility
* 1.9.x (last tested: 1.9.0)
* 1.8.x (last tested: 1.8.0)
* 1.7.x (last tested: 1.7.10)
* 1.6.x (last tested: 1.6.2)
* 1.4.x (last tested: 1.4.5)

Earlier versions is not tested.

Expand Down
4 changes: 4 additions & 0 deletions src/ngx_http_vhost_traffic_status_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,12 @@ ngx_http_vhost_traffic_status_shm_add_upstream(ngx_http_request_t *r,
ms = 0;
for ( ;; ) {
if (state[i].status) {
#if !defined(nginx_version) || nginx_version < 1009001
ms += (ngx_msec_int_t)
(state[i].response_sec * 1000 + state[i].response_msec);
#else
ms += state[i].response_time;
#endif
}
if (++i == r->upstream_states->nelts) {
break;
Expand Down

0 comments on commit 3822810

Please sign in to comment.