Update ctime and first atime on conn handling thr, not on thrmgr

This offloads the thrmgr by saving a time() call.
Also remove an unnecessary NULL assignment.
pull/48/head
Soner Tari 4 years ago
parent 71dff82305
commit 14cfd3286b

@ -178,11 +178,6 @@ proxy_conn_ctx_new(evutil_socket_t fd,
ctx->global = global;
ctx->clisock = clisock;
ctx->ctime = time(NULL);
ctx->atime = ctx->ctime;
ctx->next = NULL;
#ifdef HAVE_LOCAL_PROCINFO
ctx->lproc.pid = -1;
#endif /* HAVE_LOCAL_PROCINFO */

@ -1766,6 +1766,9 @@ pxy_conn_init(pxy_conn_ctx_t *ctx)
pxy_thr_attach(ctx);
ctx->ctime = time(NULL);
ctx->atime = ctx->ctime;
if (check_fd_usage(
#ifdef DEBUG_PROXY
ctx

@ -235,6 +235,9 @@ prototcp_connect(UNUSED evutil_socket_t fd, UNUSED short what, void *arg)
pxy_thr_attach(ctx);
ctx->ctime = time(NULL);
ctx->atime = ctx->ctime;
if (check_fd_usage(
#ifdef DEBUG_PROXY
ctx

@ -135,11 +135,6 @@ proxy_conn_ctx_new(evutil_socket_t fd,
}
ctx->opts = opts;
ctx->ctime = time(NULL);
ctx->atime = ctx->ctime;
ctx->next = NULL;
return ctx;
}

Loading…
Cancel
Save