BIND 10 trac806, updated. ad04d070072126a8f221f67244e9a54e68b53955 [trac806] explicitly defined the copy constructor.
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Apr 11 08:31:32 UTC 2011
The branch, trac806 has been updated
via ad04d070072126a8f221f67244e9a54e68b53955 (commit)
via fb99e325e667a39ef88b6c8fab128a8df862a786 (commit)
via 31b96198427b2c140556afcd61ff3809c43266f6 (commit)
from 0a2a239a12af8c0ee54d62cb34d170c6cfdd33f9 (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 ad04d070072126a8f221f67244e9a54e68b53955
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Apr 11 01:30:52 2011 -0700
[trac806] explicitly defined the copy constructor.
commit fb99e325e667a39ef88b6c8fab128a8df862a786
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Apr 9 10:52:25 2011 -0700
[trac806] corrected comments in Rdata_RP_Test.toWireRenderer about compression.
the previous one was wrong due to naive copy-paste.
commit 31b96198427b2c140556afcd61ff3809c43266f6
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Sat Apr 9 10:48:23 2011 -0700
[trac806] added blank lines for better readability
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rdata.h | 11 +++++++++++
src/lib/dns/rdata/generic/rp_17.cc | 8 ++++++++
src/lib/dns/tests/rdata_rp_unittest.cc | 5 ++++-
3 files changed, 23 insertions(+), 1 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata.h b/src/lib/dns/rdata.h
index 8eaedd3..0908c75 100644
--- a/src/lib/dns/rdata.h
+++ b/src/lib/dns/rdata.h
@@ -161,6 +161,7 @@ public:
///
/// \return A string representation of \c Rdata.
virtual std::string toText() const = 0;
+
/// \brief Render the \c Rdata in the wire format into a buffer.
///
/// This is a pure virtual method without the definition; the actual
@@ -169,6 +170,7 @@ public:
///
/// \param buffer An output buffer to store the wire data.
virtual void toWire(OutputBuffer& buffer) const = 0;
+
/// \brief Render the \c Rdata in the wire format into a
/// \c MessageRenderer object.
///
@@ -251,6 +253,7 @@ public:
/// \param rdata_string A string of textual representation of generic
/// RDATA.
explicit Generic(const std::string& rdata_string);
+
///
/// \brief Constructor from wire-format data.
///
@@ -273,6 +276,7 @@ public:
/// \c Rdata to parse.
/// \param rdata_len The length in buffer of the \c Rdata. In bytes.
Generic(InputBuffer& buffer, size_t rdata_len);
+
///
/// \brief The destructor.
virtual ~Generic();
@@ -284,6 +288,7 @@ public:
///
/// \param source A reference to a \c generic::Generic object to copy from.
Generic(const Generic& source);
+
///
/// \brief The assignment operator.
///
@@ -293,6 +298,7 @@ public:
/// \param source A reference to a \c generic::Generic object to copy from.
Generic& operator=(const Generic& source);
//@}
+
///
/// \name Converter methods
///
@@ -307,6 +313,7 @@ public:
///
/// \return A string representation of \c generic::Generic.
virtual std::string toText() const;
+
///
/// \brief Render the \c generic::Generic in the wire format into a buffer.
///
@@ -317,6 +324,7 @@ public:
///
/// \param buffer An output buffer to store the wire data.
virtual void toWire(OutputBuffer& buffer) const;
+
/// \brief Render the \c generic::Generic in the wire format into a
/// \c MessageRenderer object.
///
@@ -329,6 +337,7 @@ public:
/// output buffer in which the \c Generic object is to be stored.
virtual void toWire(MessageRenderer& renderer) const;
//@}
+
///
/// \name Comparison method
///
@@ -421,6 +430,7 @@ std::ostream& operator<<(std::ostream& os, const Generic& rdata);
/// object.
RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
const std::string& rdata_string);
+
/// \brief Create RDATA of a given pair of RR type and class from
/// wire-format data.
///
@@ -444,6 +454,7 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
/// object.
RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
InputBuffer& buffer, size_t len);
+
/// \brief Create RDATA of a given pair of RR type and class, copying
/// of another RDATA of same kind.
///
diff --git a/src/lib/dns/rdata/generic/rp_17.cc b/src/lib/dns/rdata/generic/rp_17.cc
index fdd0ff8..5b39dc3 100644
--- a/src/lib/dns/rdata/generic/rp_17.cc
+++ b/src/lib/dns/rdata/generic/rp_17.cc
@@ -74,6 +74,14 @@ RP::RP(const std::string& rp_str) :
RP::RP(InputBuffer& buffer, size_t) : mailbox_(buffer), text_(buffer) {
}
+/// \brief Copy constructor.
+///
+/// \exception std::bad_alloc Memory allocation fails in copying internal
+/// member variables (this should be very rare).
+RP::RP(const RP& other) :
+ Rdata(), mailbox_(other.mailbox_), text_(other.text_)
+{}
+
/// \brief Convert the \c RP to a string.
///
/// The output of this method is formatted as described in the "from string"
diff --git a/src/lib/dns/tests/rdata_rp_unittest.cc b/src/lib/dns/tests/rdata_rp_unittest.cc
index d32030a..52285f1 100644
--- a/src/lib/dns/tests/rdata_rp_unittest.cc
+++ b/src/lib/dns/tests/rdata_rp_unittest.cc
@@ -119,7 +119,10 @@ TEST_F(Rdata_RP_Test, toWireBuffer) {
}
TEST_F(Rdata_RP_Test, toWireRenderer) {
- // similar to toWireBuffer, but names in RDATA should be compressed.
+ // similar to toWireBuffer, but names in RDATA could be compressed due to
+ // preceding names. Actually they must not be compressed according to
+ // RFC3597, and this test checks that.
+
UnitTestUtil::readWireData("rdata_rp_toWire2.wire", expected_wire);
renderer.writeName(Name("a.example.com"));
More information about the bind10-changes
mailing list