Skip to content

Commit

Permalink
tmp: abort on specific assert
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukáš Ondráček committed Nov 27, 2024
1 parent cfc6577 commit c24710a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion daemon/defer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ static inline void defer_sample_addr(const union kr_sockaddr *addr, bool stream)

if (defer_sample_state.addr.ip.sa_family != AF_UNSPEC) {
// TODO: this costs performance, so only in some debug mode?
kr_assert(kr_sockaddr_cmp(&addr->ip, &defer_sample_state.addr.ip) == kr_ok());
if (kr_fails_assert(kr_sockaddr_cmp(&addr->ip, &defer_sample_state.addr.ip) == kr_ok())) {
kr_log_error(DEFER, "%s != %s\n",
kr_straddr(&addr->ip),
kr_straddr(&defer_sample_state.addr.ip));
abort();
}
return;
}

Expand Down

0 comments on commit c24710a

Please sign in to comment.