diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-02-09 19:07:55 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-02-09 19:07:55 +0300 |
commit | 24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad (patch) | |
tree | d1b85adebedad36ef9d71d00279f3fd380aa62ce /src/nxt_router.c | |
parent | fc496c19ac124c7412e1539d15dd99decc4ecd33 (diff) | |
download | unit-24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad.tar.gz unit-24d07cfdd2b660d11e3ba7f5e77a6c690bfff8ad.tar.bz2 |
Made nxt_assert() statements to be compiled only with debug.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_router.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); } |