Lines Matching refs:pending
40 * wait for the pending answer events.
86 static int randomize_and_send_udp(struct pending* pend, sldns_buffer* packet,
106 struct pending *p1 = (struct pending*)key1;
107 struct pending *p2 = (struct pending*)key2;
207 * @param pend: pending tcp structure, for storing the local address choice.
376 if(!reuse || !reuse->pending || !reuse->pending->c)
381 reuse->pending->c->fd);
500 pend_tcp->reuse.pending = pend_tcp;
546 key_p.reuse.pending = &key_p;
565 log_assert(&key_p != ((struct reuse_tcp*)result)->pending);
772 pend->reuse.pending = pend;
980 pend_tcp = reuse->pending;
984 w->next_waiting = (void*)reuse->pending;
986 if(reuse->pending->query) {
992 comm_point_stop_listening(reuse->pending->c);
993 reuse->pending->query = w;
995 reuse->pending->c->fd, reuse->pending,
1001 pend->reuse.pending = pend;
1130 * and thus have a pending pointer to the struct */
1131 log_assert(reuse->lru_prev->pending);
1135 log_assert(!reuse->lru_next || reuse->lru_next->pending);
1145 * and thus have a pending pointer to the struct */
1146 log_assert(reuse->lru_next->pending);
1150 log_assert(!reuse->lru_prev || reuse->lru_prev->pending);
1164 reuse->pending = NULL;
1252 /** perform callbacks for failure and also decommission pending tcp.
1253 * the callbacks remove references in sq->pending to the waiting_tcp
1254 * members of the tree_by_id in the pending tcp. The pending_tcp is
1449 struct pending* pend;
1466 /* callback error on pending */
1484 struct pending key;
1485 struct pending* p;
1507 verbose(VERB_ALGO, "lookup size is %d entries", (int)outnet->pending->count);
1508 p = (struct pending*)rbtree_search(outnet->pending, &key);
1549 (void)rbtree_delete(outnet->pending, p->node.key);
1590 struct pending* p = (struct pending*)arg;
1601 struct pending* p = (struct pending*)arg;
1753 !(outnet->pending = rbtree_create(pending_cmp)) ||
1825 /** helper pending delete */
1829 struct pending* pend = (struct pending*)node;
1861 if(outnet->pending) {
1862 /* free pending elements, but do no unlink from tree. */
1863 traverse_postorder(outnet->pending, pending_node_del, NULL);
1864 free(outnet->pending);
1940 /* was allocated in struct pending that was deleted above */
1945 struct pending* p = outnet->udp_wait_first, *np;
1956 pending_delete(struct outside_network* outnet, struct pending* p)
1963 struct pending* prev = NULL, *x = outnet->udp_wait_first;
1978 (void)rbtree_delete(outnet->pending, p->node.key);
2044 select_id(struct outside_network* outnet, struct pending* pend,
2053 while(!rbtree_insert(outnet->pending, &pend->node)) {
2064 verbose(VERB_ALGO, "inserted new pending reply id=%4.4x", pend->id);
2112 select_ifport(struct outside_network* outnet, struct pending* pend,
2215 randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout)
2273 struct pending*
2277 struct pending* pend = (struct pending*)calloc(1, sizeof(*pend));
2352 reuse_cb_and_decommission(outnet, reuse->pending, NETEVENT_CLOSED);
2443 verbose(VERB_ALGO, "pending tcp query with too short buffer < 2");
2453 log_assert(reuse->pending);
2454 pend = reuse->pending;
2466 log_assert(!reuse || (pend == reuse->pending));
2530 pend->reuse.pending = pend;
2691 sq->pending = NULL;
2753 if(sq->pending) {
2754 /* clear up the pending query */
2759 struct pending* p = (struct pending*)sq->pending;
2769 sq->pending;
2797 sq->pending = NULL;
2940 sq->pending = pending_udp_query(sq, buff, rtt,
2942 if(!sq->pending)
3094 struct waiting_tcp* w = (struct waiting_tcp*)sq->pending;
3102 sq->pending = NULL; /* removed after this callback */
3195 sq->pending = pending_tcp_query(sq, buff, sq->outnet->tcp_auth_query_timeout,
3198 if(!sq->pending) {
3231 sq->pending = pending_tcp_query(sq, buff, timeout,
3234 return sq->pending != NULL;
3283 struct pending* p = (struct pending*)sq->pending;
3286 sq->pending = NULL; /* removed after callback */
3884 waiting_udp_get_mem(struct pending* w)
3896 struct pending* u;
3923 s += sizeof(*outnet->pending);
3924 s += (sizeof(struct pending) + comm_timer_get_mem(NULL)) *
3925 outnet->pending->count;
3948 s += sizeof(struct pending);