BIND 10 master, updated. df2502bc7f9600f03dc410f01b1e6e060ea427ff [master] Fix test that failed on NetBSD
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 15 00:31:36 UTC 2011
The branch, master has been updated
via df2502bc7f9600f03dc410f01b1e6e060ea427ff (commit)
from 729bbdeb813e99a5f8323f29593f2aaadc95ce3f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit df2502bc7f9600f03dc410f01b1e6e060ea427ff
Author: Jelte Jansen <jelte at isc.org>
Date: Tue Mar 15 01:24:07 2011 +0100
[master] Fix test that failed on NetBSD
Was not NetBSD-specific, but the symptom only appeared to show there; you cannot reliably do 2 tcp async_send's without waiting for the completion in between.
Fixed it by writing output to a temporary buffer that includes the TCP length data (we might want to consider allowing MessageRenderer to append to a buffer, btw)
-----------------------------------------------------------------------
Summary of changes:
.../resolve/tests/recursive_query_unittest_2.cc | 23 +++++++++----------
1 files changed, 11 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/resolve/tests/recursive_query_unittest_2.cc b/src/lib/resolve/tests/recursive_query_unittest_2.cc
index 12ff3cf..4799324 100644
--- a/src/lib/resolve/tests/recursive_query_unittest_2.cc
+++ b/src/lib/resolve/tests/recursive_query_unittest_2.cc
@@ -443,8 +443,10 @@ public:
setReferralExampleOrg(msg);
// Convert to wire format
- tcp_send_buffer_->clear();
- MessageRenderer renderer(*tcp_send_buffer_);
+ // Use a temporary buffer for the dns wire data (we copy it
+ // to the 'real' buffer below)
+ OutputBuffer msg_buf(BUFFER_SIZE);
+ MessageRenderer renderer(msg_buf);
msg.toWire(renderer);
// Expected next state (when checked) is the UDP query to example.org.
@@ -455,16 +457,13 @@ public:
expected_ = UDP_EXAMPLE_ORG;
tcp_cumulative_ = 0;
- // We'll write the message in two parts, the count and the message
- // itself. This saves having to prepend the count onto the start of a
- // buffer. When specifying the send handler, the expected size of the
- // data written is passed as the first parameter so that the handler
- // can check it.
- uint8_t count[2];
- writeUint16(tcp_send_buffer_->getLength(), count);
- tcp_socket_.async_send(asio::buffer(count, 2),
- boost::bind(&RecursiveQueryTest2::tcpSendHandler, this,
- 2, _1, _2));
+ // Unless we go through a callback loop we cannot simply use
+ // async_send() multiple times, so we cannot send the size first
+ // followed by the actual data. We copy them to a new buffer
+ // first
+ tcp_send_buffer_->clear();
+ tcp_send_buffer_->writeUint16(msg_buf.getLength());
+ tcp_send_buffer_->writeData(msg_buf.getData(), msg_buf.getLength());
tcp_socket_.async_send(asio::buffer(tcp_send_buffer_->getData(),
tcp_send_buffer_->getLength()),
boost::bind(&RecursiveQueryTest2::tcpSendHandler, this,
More information about the bind10-changes
mailing list