tor_free(or_conn->nickname);
if (or_conn->chan) {
/* Owww, this shouldn't happen, but... */
+ channel_t *base_chan = TLS_CHAN_TO_BASE(or_conn->chan);
+ tor_assert(base_chan);
log_info(LD_CHANNEL,
"Freeing orconn at %p, saw channel %p with ID "
"%"PRIu64 " left un-NULLed",
- or_conn, TLS_CHAN_TO_BASE(or_conn->chan),
- (
- TLS_CHAN_TO_BASE(or_conn->chan)->global_identifier));
- if (!CHANNEL_FINISHED(TLS_CHAN_TO_BASE(or_conn->chan))) {
- channel_close_for_error(TLS_CHAN_TO_BASE(or_conn->chan));
+ or_conn, base_chan,
+ base_chan->global_identifier);
+ if (!CHANNEL_FINISHED(base_chan)) {
+ channel_close_for_error(base_chan);
}
or_conn->chan->conn = NULL;
/* it would be more efficient to do a slice, but this case is rare */
smartlist_t *or_conns = smartlist_new();
SMARTLIST_FOREACH_BEGIN(channels, channel_t *, channel) {
+ tor_assert(channel); // Suppresses some compiler warnings.
+
if (!common_ed25519_identity)
common_ed25519_identity = &channel->ed25519_identity;
channelpadding_negotiate_t disable;
cell_t cell;
+ tor_assert(chan);
tor_assert(BASE_CHAN_TO_TLS(chan)->conn->link_proto >=
MIN_LINK_PROTO_FOR_CHANNEL_PADDING);
channelpadding_negotiate_t enable;
cell_t cell;
+ tor_assert(chan);
tor_assert(BASE_CHAN_TO_TLS(chan)->conn->link_proto >=
MIN_LINK_PROTO_FOR_CHANNEL_PADDING);
static inline size_t
channel_outbuf_length(channel_t *chan)
{
+ tor_assert(chan);
/* In theory, this can not happen because we can not scheduler a channel
* without a connection that has its outbuf initialized. Just in case, bug
* on this so we can understand a bit more why it happened. */
{
#ifdef HAVE_KIST_SUPPORT
int64_t tcp_space, extra_space;
+ tor_assert(ent);
+ tor_assert(ent->chan);
const tor_socket_t sock =
TO_CONN(BASE_CHAN_TO_TLS((channel_t *) ent->chan)->conn)->s;
struct tcp_info tcp;
* kernel */
MOCK_IMPL(void, channel_write_to_kernel, (channel_t *chan))
{
+ tor_assert(chan);
log_debug(LD_SCHED, "Writing %lu bytes to kernel for chan %" PRIu64,
(unsigned long)channel_outbuf_length(chan),
chan->global_identifier);