]> granicus.if.org Git - pdns/commitdiff
our delaypipe tests sometimes fail, this might at least tell us why. perhaps.
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 1 Dec 2015 09:04:36 +0000 (10:04 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 1 Dec 2015 09:08:54 +0000 (10:08 +0100)
pdns/delaypipe.cc

index b2a4e5a2e618928b92cb5f45a536d788b535660e..333a08ea5ef87189f7f69b869ebd9328f4c32730 100644 (file)
@@ -44,6 +44,8 @@ bool ObjectPipe<T>::read(T* t)
     unixDie("read");
   if(ret==0)
     return false;
+  if(ret != sizeof(ptr))
+    throw std::runtime_error("Partial read, should not happen");    
   *t=*ptr;
   delete ptr;
   return true;
@@ -66,6 +68,8 @@ int ObjectPipe<T>::readTimeout(T* t, double msec)
     unixDie("read");
   if(ret==0)
     return false;
+  if(ret != sizeof(ptr))
+    throw std::runtime_error("Partial read, should not happen 2");    
   *t=*ptr;
   delete ptr;
   return 1;