Parcourir la source

[trac806] provide a bit more detailed information when throwing an exception
due to rdlen mismatch.

not directly related to the task of this ticket, but encountered a situation
where it could be useful while testing.

JINMEI Tatuya il y a 14 ans
Parent
commit
5861ae7cb0
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/lib/dns/rdata.cc

+ 2 - 1
src/lib/dns/rdata.cc

@@ -66,7 +66,8 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
                                                    len);
                                                    
     if (buffer.getPosition() - old_pos != len) {
-        isc_throw(InvalidRdataLength, "RDLENGTH mismatch");
+        isc_throw(InvalidRdataLength, "RDLENGTH mismatch: " <<
+                  buffer.getPosition() - old_pos << " != " << len);
     }
 
     return (rdata);