From 24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 9 Feb 2018 19:07:55 +0300 Subject: Made nxt_assert() statements to be compiled only with debug. --- src/nxt_router.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/nxt_router.c') diff --git a/src/nxt_router.c b/src/nxt_router.c index 53761e4f..36f5264d 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -117,11 +117,15 @@ nxt_router_ra_inc_use(nxt_req_app_link_t *ra) nxt_inline void nxt_router_ra_dec_use(nxt_req_app_link_t *ra) { +#if (NXT_DEBUG) int c; c = nxt_atomic_fetch_add(&ra->use_count, -1); nxt_assert(c > 1); +#else + (void) nxt_atomic_fetch_add(&ra->use_count, -1); +#endif } static void nxt_router_ra_use(nxt_task_t *task, nxt_req_app_link_t *ra, int i); @@ -3005,18 +3009,24 @@ nxt_router_app_quit(nxt_task_t *task, nxt_app_t *app) static void nxt_router_app_process_request(nxt_task_t *task, void *obj, void *data) { - nxt_app_t *app; nxt_req_app_link_t *ra; - app = obj; ra = data; +#if (NXT_DEBUG) + { + nxt_app_t *app; + + app = obj; + nxt_assert(app != NULL); nxt_assert(ra != NULL); nxt_assert(ra->app_port != NULL); nxt_debug(task, "app '%V' %p process next stream #%uD", &app->name, app, ra->stream); + } +#endif nxt_router_app_prepare_request(task, ra); } -- cgit