Skip to content

Commit 6a8fa79

Browse files
committed
$ssl_handshake_time bugfix
1 parent c6a9451 commit 6a8fa79

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/event/ngx_event_openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5448,7 +5448,7 @@ ngx_ssl_get_handshake_time(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
54485448
tp = ngx_timeofday();
54495449

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

54535453
} else {
54545454
ms = c->ssl->handshake_end_msec - c->ssl->handshake_start_msec;
@@ -5484,7 +5484,7 @@ ngx_ssl_get_handshake_time_msec(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t
54845484
tp = ngx_timeofday();
54855485

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

54895489
} else {
54905490
ms = c->ssl->handshake_end_msec - c->ssl->handshake_start_msec;

src/stream/ngx_stream_ssl_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ static ngx_stream_variable_t ngx_stream_ssl_vars[] = {
305305
{ ngx_string("ssl_handshakd_time"), NULL, ngx_stream_ssl_variable,
306306
(uintptr_t) ngx_ssl_get_handshake_time, NGX_STREAM_VAR_CHANGEABLE, 0 },
307307

308-
{ ngx_string("ssl_handshake_time"), NULL, ngx_http_ssl_variable,
309-
(uintptr_t) ngx_ssl_get_handshake_time, NGX_HTTP_VAR_CHANGEABLE, 0 },
308+
{ ngx_string("ssl_handshake_time"), NULL, ngx_stream_ssl_variable,
309+
(uintptr_t) ngx_ssl_get_handshake_time, NGX_STREAM_VAR_CHANGEABLE, 0 },
310310

311311
{ ngx_string("ssl_handshake_time_msec"), NULL, ngx_stream_ssl_variable,
312312
(uintptr_t) ngx_ssl_get_handshake_time_msec, NGX_STREAM_VAR_CHANGEABLE, 0 },

0 commit comments

Comments
 (0)