Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ngx_stream_lua_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ ngx_stream_lua_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_stream_lua_srv_conf_t *conf = child;

#if (NGX_STREAM_SSL)
#if defined(nginx_version) && nginx_version >= 1025005
#if !defined (freenginx) && (defined(nginx_version) && nginx_version >= 1025005)
ngx_stream_ssl_srv_conf_t *sscf;
#else
ngx_stream_ssl_conf_t *sscf;
Expand Down
4 changes: 4 additions & 0 deletions src/ngx_stream_lua_socket_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,9 @@ ngx_stream_lua_socket_tcp_serversslhandshake(lua_State *L)
ngx_stream_lua_ctx_t *ctx;
ngx_stream_lua_co_ctx_t *coctx;
ngx_stream_lua_socket_tcp_upstream_t *u;
#if !defined (freenginx)
ngx_stream_ssl_srv_conf_t *sscf;
#endif

/* Lua function arguments: self */

Expand Down Expand Up @@ -2317,6 +2319,7 @@ ngx_stream_lua_socket_tcp_serversslhandshake(lua_State *L)
return 1;
}

#if !defined (freenginx)
sscf = ngx_stream_get_module_srv_conf(r->session, ngx_stream_ssl_module);

if (sscf == NULL || sscf->ssl.ctx == NULL) {
Expand All @@ -2330,6 +2333,7 @@ ngx_stream_lua_socket_tcp_serversslhandshake(lua_State *L)
lua_pushliteral(L, "failed to create ssl connection");
return 2;
}
#endif

ctx = ngx_stream_lua_get_module_ctx(r, ngx_stream_lua_module);
if (ctx == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/ngx_stream_lua_ssl_certby.c
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,7 @@ ngx_stream_lua_ffi_ssl_verify_client(ngx_stream_lua_request_t *r,

ngx_stream_lua_ctx_t *ctx;
ngx_ssl_conn_t *ssl_conn;
#if defined(nginx_version) && nginx_version >= 1025005
#if !defined (freenginx) && (defined(nginx_version) && nginx_version >= 1025005)
ngx_stream_ssl_srv_conf_t *sscf;
#else
ngx_stream_ssl_conf_t *sscf;
Expand Down
2 changes: 1 addition & 1 deletion src/ngx_stream_lua_ssl_client_helloby.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ ngx_stream_lua_ssl_client_hello_handler(ngx_ssl_conn_t *ssl_conn,
return -1;
}

#if (nginx_version > 1029001)
#if !(freenginx) && (nginx_version > 1029001)
#ifdef SSL_CLIENT_HELLO_SUCCESS
/* see commit 0373fe5d98c1515640 for more details */
rc = ngx_ssl_client_hello_callback(ssl_conn, al, arg);
Expand Down
14 changes: 14 additions & 0 deletions src/ngx_stream_lua_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,21 @@ ngx_stream_lua_ffi_now(void)
double
ngx_stream_lua_ffi_req_start_time(ngx_stream_lua_request_t *r)
{
#if defined freenginx
ngx_time_t *tp;

tp = ngx_timeofday();
tp->sec -= (ngx_current_msec - r->session->start_time) / 1000;
tp->msec -= (ngx_current_msec - r->session->start_time) % 1000;
if (tp->msec > NGX_MAX_INT_T_VALUE) {
tp->msec += 1000;
tp->sec -= 1;
}

return tp->sec + tp->msec / 1000.0;
#else
return r->session->start_sec + r->session->start_msec / 1000.0;
#endif
}


Expand Down