From: Stephen Morris Date: Thu, 2 Feb 2012 16:11:07 +0000 (+0000) Subject: [1604b] BasicRRset::getRRsig() now returns empty RRset X-Git-Tag: trac2351_base~270 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5a196c2aaa02ab50f8bb50f9e23cdff7e945559;p=thirdparty%2Fkea.git [1604b] BasicRRset::getRRsig() now returns empty RRset ... instead of throwing an exception. --- diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h index 601355b40a..fe66676977 100644 --- a/src/lib/dns/rrset.h +++ b/src/lib/dns/rrset.h @@ -740,94 +740,47 @@ public: /// /// \name Associated RRSIG methods /// - /// The associated RRSIG RRset is not supported in BasicRRset, so these - /// methods throw a NotImplemented exception. + /// The associated RRSIG RRset is not supported in BasicRRset. For + /// ease of use, getRRsig() returns a null pointer (indicating no RRset). + /// The addRRsig()/removeRRsig() methods throw a "NotImplemented" + /// exception - if you are using a BasicRRset, you should not be trying + /// to modify signatures on it. //@{ /// \brief Return pointer to this RRset's RRSIG RRset /// /// \exception NotImplemented Always thrown. Associated RRSIG RRsets are /// not supported in this class. /// - /// \return Never returns normally - always throws a NotImplemented - /// exception. + /// \return Null pointer, as this class does not support RRSIG records. virtual RRsetPtr getRRsig() const { - isc_throw(NotImplemented, - "BasicRRset does not implement the getRRsig() method"); + return (RRsetPtr()); } - /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset - /// - /// Not implemented in this class. - /// - /// \param rdata RRSIG rdata to be added to this RRset - /// - /// \exception NotImplemented Always thrown. Associated RRSIG RRsets are - /// not supported in this class. virtual void addRRsig(const rdata::ConstRdataPtr) { isc_throw(NotImplemented, "BasicRRset does not implement the addRRsig() method"); } - /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset - /// - /// Not implemented in this class. - /// (This overload is for an older version of boost that doesn't support - /// conversion from shared_ptr to shared_ptr.) - /// - /// \param rdata RRSIG rdata to be added to this RRset - /// - /// \exception NotImplemented Always thrown. Associated RRSIG RRsets are - /// not supported in this class. virtual void addRRsig(const rdata::RdataPtr) { isc_throw(NotImplemented, "BasicRRset does not implement the addRRsig() method"); } - /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset - /// - /// Not implemented in this class. - /// - /// \param sigs RRSIG RRset containing signatures to be added to the - /// RRSIG RRset associated with this class. - /// - /// \exception NotImplemented Always thrown. Associated RRSIG RRsets are - /// not supported in this class. virtual void addRRsig(const AbstractRRset&) { isc_throw(NotImplemented, "BasicRRset does not implement the addRRsig() method"); } - /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset - /// - /// Not implemented in this class. - /// - /// \param sigs Pointer to a RRSIG RRset containing signatures to be added - /// to the RRSIG RRset associated with this class. - /// - /// \exception NotImplemented Always thrown. Associated RRSIG RRsets are - /// not supported in this class. virtual void addRRsig(ConstRRsetPtr) { isc_throw(NotImplemented, "BasicRRset does not implement the addRRsig() method"); } - /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset - /// - /// Not implemented in this class. - /// (This overload is for an older version of boost that doesn't support - /// conversion from shared_ptr to shared_ptr.) - /// - /// \param sigs Pointer to a RRSIG RRset containing signatures to be added - /// to the RRSIG RRset associated with this class. - /// - /// \exception NotImplemented Always thrown. Associated RRSIG RRsets are - /// not supported in this class. virtual void addRRsig(RRsetPtr) { isc_throw(NotImplemented, "BasicRRset does not implement the addRRsig() method"); } - /// \brief Clear the RRSIGs for this RRset virtual void removeRRsig() { isc_throw(NotImplemented, "BasicRRset does not implement the removeRRsig() method");