static int on_stream_complete(DnsStream *s, int error) {
        _cleanup_(dns_stream_unrefp) DnsStream *p = NULL;

        /* Do not let new transactions use this stream */
        if (s->server && s->server->stream == s)
                p = TAKE_PTR(s->server->stream);

        if (ERRNO_IS_DISCONNECT(error) && s->protocol != DNS_PROTOCOL_LLMNR) {
                log_debug_errno(error, "Connection failure for DNS TCP stream: %m");

                if (s->transactions) {
                        DnsTransaction *t;

                        t = s->transactions;
                        dns_server_packet_lost(t->server, IPPROTO_TCP, t->current_feature_level);
                }
        }

        if (error != 0) {
                DnsTransaction *t, *n;

                LIST_FOREACH_SAFE(transactions_by_stream, t, n, s->transactions)
                        on_transaction_stream_error(t, error);
        }

        return 0;
}
static int on_stream_complete(DnsStream *s, int error) {
        _cleanup_(dns_stream_unrefp) DnsStream *p = NULL;

         
        if (s->server && s->server->stream == s)
                p = TAKE_PTR(s->server->stream);

        if (ERRNO_IS_DISCONNECT(error) && s->protocol != DNS_PROTOCOL_LLMNR) {
                log_debug_errno(error, "Connection failure for DNS TCP stream: %m");

                if (s->transactions) {
                        DnsTransaction *t;

                        t = s->transactions;
                        dns_server_packet_lost(t->server, IPPROTO_TCP, t->current_feature_level);
                }
        }

        if (error != 0) {
                DnsTransaction *t, *n;

                LIST_FOREACH_SAFE(transactions_by_stream, t, n, s->transactions)
                        on_transaction_stream_error(t, error);
        }

        return 0;
}