diff options
Diffstat (limited to '')
-rw-r--r-- | src/nxt_fd_event.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/nxt_fd_event.c b/src/nxt_fd_event.c index a5e0a3ef..dffe1026 100644 --- a/src/nxt_fd_event.c +++ b/src/nxt_fd_event.c @@ -96,30 +96,12 @@ nxt_fd_event_hash_delete(nxt_task_t *task, nxt_lvlhsh_t *lvlhsh, nxt_fd_t fd, void nxt_fd_event_hash_destroy(nxt_lvlhsh_t *lvlhsh) { - nxt_int_t ret; - nxt_fd_event_t *ev; - nxt_lvlhsh_each_t lhe; - nxt_lvlhsh_query_t lhq; - - nxt_memzero(&lhe, sizeof(nxt_lvlhsh_each_t)); - lhe.proto = &nxt_event_set_fd_hash_proto; - lhq.proto = &nxt_event_set_fd_hash_proto; - - for ( ;; ) { - ev = nxt_lvlhsh_each(lvlhsh, &lhe); + nxt_fd_event_t *ev; - if (ev == NULL) { - return; - } - - lhq.key_hash = nxt_murmur_hash2(&ev->fd, sizeof(nxt_fd_t)); - - ret = nxt_lvlhsh_delete(lvlhsh, &lhq); + do { + ev = nxt_lvlhsh_retrieve(lvlhsh, &nxt_event_set_fd_hash_proto, NULL); - if (nxt_slow_path(ret != NXT_OK)) { - nxt_fd_event_hash_error(ev->task, ev->fd); - } - } + } while (ev != NULL); } |