THRIFT-603. rb: Struct read method does not call validate
authorBryan Duxbury <bryanduxbury@apache.org>
Thu, 15 Oct 2009 01:20:34 +0000 (01:20 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Thu, 15 Oct 2009 01:20:34 +0000 (01:20 +0000)
After reading a struct, we will now call the struct's validate method.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@825369 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/ext/struct.c

index 31c62d5..7429fb1 100644 (file)
@@ -591,6 +591,9 @@ static VALUE rb_thrift_struct_read(VALUE self, VALUE protocol) {
   // read struct end
   mt->read_struct_end(protocol);
 
+  // call validate
+  rb_funcall(self, validate_method_id, 0);
+
   return Qnil;
 }