Commit e8ec4c91 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2098] make sure unexpected method call doesn't happen by exception/assert

parent b166b606
......@@ -250,6 +250,7 @@ public:
virtual void setCompressMode(CompressMode) {}
virtual void writeName(const LabelSequence&, bool) {
// We don't need this version of writeName
isc_throw(Unexpected, "unexpected version of writeName is called");
}
// Called for each domain name in the RDATA, from the RDATA's toWire()
......
......@@ -116,7 +116,11 @@ public:
virtual void writeName(const Name& name, const bool = false) {
name.toWire(getBuffer());
}
virtual void writeName(const LabelSequence&, const bool) {} // unused
virtual void writeName(const LabelSequence&, const bool) {
// We shouldn't use this version of writeName (and we internally
// control it, so we simply assert it here)
assert(false);
}
};
void
......
......@@ -277,7 +277,9 @@ OldMessageRenderer::writeName(const Name& name, const bool compress) {
void
OldMessageRenderer::writeName(const LabelSequence&, const bool) {
// we don't use this mode for the benchmark
// We shouldn't use this version of writeName (and we internally
// control it, so we simply assert it here)
assert(false);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment