Lines Matching refs:channel
40 static unsigned short generate_unique_qid(ares_channel_t *channel)
45 id = ares__generate_new_id(channel->rand_state);
46 } while (ares__htable_szvp_get(channel->queries_by_qid, id, NULL));
51 ares_status_t ares_send_ex(ares_channel_t *channel, const unsigned char *qbuf,
59 unsigned short id = generate_unique_qid(channel);
68 if (ares__slist_len(channel->servers) == 0) {
74 status = ares_qcache_fetch(channel, &now, qbuf, qlen, &abuf, &alen);
91 query->channel = channel;
116 packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
117 query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz;
128 ares__llist_insert_last(channel->all_queries, query);
138 if (!ares__htable_szvp_insert(channel->queries_by_qid, query->qid, query)) {
153 void ares_send(ares_channel_t *channel, const unsigned char *qbuf, int qlen,
156 if (channel == NULL) {
160 ares__channel_lock(channel);
162 ares_send_ex(channel, qbuf, (size_t)qlen, callback, arg, NULL);
164 ares__channel_unlock(channel);
167 size_t ares_queue_active_queries(ares_channel_t *channel)
171 if (channel == NULL) {
175 ares__channel_lock(channel);
177 len = ares__llist_len(channel->all_queries);
179 ares__channel_unlock(channel);