mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-26 19:54:53 +02:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user