Skip to content

Commit

Permalink
$ssl_handshake_time bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wa5i committed Jun 26, 2019
1 parent c6a9451 commit 6a8fa79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/event/ngx_event_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5448,7 +5448,7 @@ ngx_ssl_get_handshake_time(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
tp = ngx_timeofday();

if (c->ssl->handshake_end_msec == 0) {
ms = tp->sec * 1000 + tp->sec - c->ssl->handshake_start_msec;
ms = tp->sec * 1000 + tp->msec - c->ssl->handshake_start_msec;

} else {
ms = c->ssl->handshake_end_msec - c->ssl->handshake_start_msec;
Expand Down Expand Up @@ -5484,7 +5484,7 @@ ngx_ssl_get_handshake_time_msec(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t
tp = ngx_timeofday();

if (c->ssl->handshake_end_msec == 0) {
ms = tp->sec * 1000 + tp->sec - c->ssl->handshake_start_msec;
ms = tp->sec * 1000 + tp->msec - c->ssl->handshake_start_msec;

} else {
ms = c->ssl->handshake_end_msec - c->ssl->handshake_start_msec;
Expand Down
4 changes: 2 additions & 2 deletions src/stream/ngx_stream_ssl_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ static ngx_stream_variable_t ngx_stream_ssl_vars[] = {
{ ngx_string("ssl_handshakd_time"), NULL, ngx_stream_ssl_variable,
(uintptr_t) ngx_ssl_get_handshake_time, NGX_STREAM_VAR_CHANGEABLE, 0 },

{ ngx_string("ssl_handshake_time"), NULL, ngx_http_ssl_variable,
(uintptr_t) ngx_ssl_get_handshake_time, NGX_HTTP_VAR_CHANGEABLE, 0 },
{ ngx_string("ssl_handshake_time"), NULL, ngx_stream_ssl_variable,
(uintptr_t) ngx_ssl_get_handshake_time, NGX_STREAM_VAR_CHANGEABLE, 0 },

{ ngx_string("ssl_handshake_time_msec"), NULL, ngx_stream_ssl_variable,
(uintptr_t) ngx_ssl_get_handshake_time_msec, NGX_STREAM_VAR_CHANGEABLE, 0 },
Expand Down

0 comments on commit 6a8fa79

Please sign in to comment.