Skip to content

Commit 040f865

Browse files
committed
fix(log): fix start time being incorrect on some proxies
1 parent c35a5d2 commit 040f865

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ngx_http_redirectionio_protocol.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,11 @@ ngx_int_t ngx_http_redirectionio_protocol_send_log(ngx_connection_t *c, ngx_http
182182

183183
ngx_http_redirectionio_log_t* ngx_http_redirectionio_protocol_create_log(ngx_http_request_t *r, ngx_http_redirectionio_ctx_t *ctx, ngx_str_t *project_key) {
184184
const char *client_ip, *log_serialized;
185+
uint64_t time = ((uint64_t)r->start_sec * 1000) + (uint64_t)r->start_msec;
185186
ngx_http_redirectionio_log_t *log;
186187

187188
client_ip = ngx_http_redirectionio_str_to_char(&r->connection->addr_text, r->pool);
188-
log_serialized = redirectionio_api_create_log_in_json(ctx->request, r->headers_out.status, ctx->response_headers, ctx->action, PROXY_VERSION_STR(PROXY_VERSION), r->start_msec, client_ip);
189+
log_serialized = redirectionio_api_create_log_in_json(ctx->request, r->headers_out.status, ctx->response_headers, ctx->action, PROXY_VERSION_STR(PROXY_VERSION), time, client_ip);
189190

190191
if (log_serialized == NULL) {
191192
return NULL;

0 commit comments

Comments
 (0)