From: Wouter Wijngaards Date: Wed, 7 Feb 2007 08:50:17 +0000 (+0000) Subject: Sets ID correctly. And udp forwarder test - test of networking code against X-Git-Tag: release-0.0~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc30ae4b9ec74e2451bbf172bc74e56c56a70c48;p=thirdparty%2Funbound.git Sets ID correctly. And udp forwarder test - test of networking code against ldns-testns and dig. git-svn-id: file:///svn/unbound/trunk@71 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index ecc04dfc2..47ac7f422 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -74,6 +74,8 @@ worker_handle_reply(struct comm_point* c, void* arg, int error, struct comm_reply* ATTR_UNUSED(reply_info)) { struct worker* worker = (struct worker*)arg; + LDNS_ID_SET(ldns_buffer_begin(worker->query_reply.c->buffer), + worker->query_id); if(error != 0) { replyerror(LDNS_RCODE_SERVFAIL, worker); return 0; @@ -96,6 +98,8 @@ static void worker_process_query(struct worker* worker) { /* query the forwarding address */ + worker->query_id = LDNS_ID_WIRE(ldns_buffer_begin( + worker->query_reply.c->buffer)); pending_udp_query(worker->back, worker->query_reply.c->buffer, &worker->fwd_addr, worker->fwd_addrlen, UDP_QUERY_TIMEOUT, worker_handle_reply, worker); diff --git a/daemon/worker.h b/daemon/worker.h index baaf756f2..34575c12d 100644 --- a/daemon/worker.h +++ b/daemon/worker.h @@ -69,6 +69,8 @@ struct worker { int num_requests; /** our one and only query, packet buffer and where to send. */ struct comm_reply query_reply; + /** id of query */ + uint16_t query_id; /** address to forward to */ struct sockaddr_storage fwd_addr; diff --git a/doc/Changelog b/doc/Changelog index 45291e97a..226952be2 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,9 @@ +7 February 2007: Wouter + - return answer with the same ID as query was sent with. + - created udp forwarder test. I've done some effort to make it perform + quickly. After servers are created, no big sleep statements but + it checks the logfiles to see if servers have come up. Takes 0.14s. + 6 February 2007: Wouter - reviewed code and improved in places. diff --git a/testdata/fwd_udp.tpkg b/testdata/fwd_udp.tpkg new file mode 100644 index 000000000..4f1590a8c Binary files /dev/null and b/testdata/fwd_udp.tpkg differ