BIND 10 trac554, updated. 74e4f864d436d960d5feea540e5573cb21dbe39c [trac554] First pass at tcp support in IOFetchProtocol
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 2 13:54:38 UTC 2011
The branch, trac554 has been updated
via 74e4f864d436d960d5feea540e5573cb21dbe39c (commit)
from bc3d1d70a2a074f3c3360ed75ea87a7fe81a4da6 (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 74e4f864d436d960d5feea540e5573cb21dbe39c
Author: Scott Mann <smann at isc.org>
Date: Wed Feb 2 06:53:18 2011 -0700
[trac554] First pass at tcp support in IOFetchProtocol
-----------------------------------------------------------------------
Summary of changes:
src/lib/asiolink/asiolink.cc | 4 +++
src/lib/asiolink/internal/iofetch.h | 4 +-
src/lib/asiolink/iofetch.cc | 41 +++++++++++++++++++++-------------
3 files changed, 31 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/asiolink/asiolink.cc b/src/lib/asiolink/asiolink.cc
index 647daf9..2caa41f 100644
--- a/src/lib/asiolink/asiolink.cc
+++ b/src/lib/asiolink/asiolink.cc
@@ -581,6 +581,10 @@ public:
InputBuffer ibuf(buffer_->getData(), buffer_->getLength());
incoming.fromWire(ibuf);
+ if (message->getHeaderFlag(Message::HEADERFLAG_TC) {
+
+ }
+
if (upstream_->size() == 0 &&
incoming.getRcode() == Rcode::NOERROR()) {
done_ = handleRecursiveAnswer(incoming);
diff --git a/src/lib/asiolink/internal/iofetch.h b/src/lib/asiolink/internal/iofetch.h
index 29c6af4..73d74ba 100644
--- a/src/lib/asiolink/internal/iofetch.h
+++ b/src/lib/asiolink/internal/iofetch.h
@@ -87,8 +87,8 @@ private:
/// to many async_*() functions) and we want keep the same data. Some of
/// the data is not copyable too.
///
- struct PrivateData;
- boost::shared_ptr<PrivateData> data_;
+ struct IOFetchProtocol;
+ boost::shared_ptr<IOFetchProtocol> data_;
};
}
diff --git a/src/lib/asiolink/iofetch.cc b/src/lib/asiolink/iofetch.cc
index 21fbcdf..bda12a4 100644
--- a/src/lib/asiolink/iofetch.cc
+++ b/src/lib/asiolink/iofetch.cc
@@ -50,16 +50,16 @@ using namespace isc::dns;
namespace asiolink {
-// Private IOFetch data (see internal/udpdns.h for reasons)
-struct IOFetch::PrivateData {
+// Private IOFetch data (see internal/iofetch.h for reasons)
+struct IOFetch::IOFetchProtocol {
// UDP Socket we send query to and expect reply from there
udp::socket socket;
// Where was the query sent
udp::endpoint remote;
// TCP Socket
- //tcp::socket tsocket;
+ tcp::socket tsocket;
// tcp endpoint
- //tcp::endpoint tremote;
+ tcp::endpoint tremote;
// What we ask the server
Question question;
// We will store the answer here
@@ -78,17 +78,24 @@ struct IOFetch::PrivateData {
// How many milliseconds are we willing to wait for answer?
int timeout;
- PrivateData(io_service& service,
- const udp::socket::protocol_type& protocol, const Question &q,
+ IOFetchProtocol(io_service& service,
+ const udp::socket::protocol_type& protocol,
+ const tcp::socket::protocol_type& tprotocol,
+ const Question &q,
OutputBufferPtr b, Callback *c) :
- socket(service, protocol),
- question(q),
- buffer(b),
- msgbuf(new OutputBuffer(512)),
- callback(c),
- stopped(false),
- timer(service)
- { }
+ socket(service, protocol),
+ tsocket(service, tprotocol),
+ question(q),
+ buffer(b),
+ msgbuf(new OutputBuffer(512)),
+ callback(c),
+ stopped(false),
+ timer(service)
+ {
+
+ }
+
+
};
/// The following functions implement the \c IOFetch class.
@@ -97,8 +104,10 @@ struct IOFetch::PrivateData {
IOFetch::IOFetch(io_service& io_service,
const Question& q, const IOAddress& addr, uint16_t port,
OutputBufferPtr buffer, Callback *callback, int timeout) :
- data_(new PrivateData(io_service,
- addr.getFamily() == AF_INET ? udp::v4() : udp::v6(), q, buffer,
+ data_(new IOFetchProtocol(io_service,
+ addr.getFamily() == AF_INET ? udp::v4() : udp::v6(),
+ addr.getFamily() == AF_INET ? tcp::v4() : tcp::v6(),
+ q, buffer,
callback))
{
data_->remote = UDPEndpoint(addr, port).getASIOEndpoint();
More information about the bind10-changes
mailing list