server GET apply pvRequest to mask

This commit is contained in:
Michael Davidsaver
2020-01-29 15:27:18 -08:00
parent 31412aff2e
commit 3bd86f9777
3 changed files with 30 additions and 19 deletions
+3 -2
View File
@@ -432,16 +432,17 @@ void to_wire_full(Buffer& buf, const Value& val)
to_wire_field(buf, Value::Helper::desc(val), Value::Helper::store(val));
}
void to_wire_valid(Buffer& buf, const Value& val)
void to_wire_valid(Buffer& buf, const Value& val, const BitMask* mask)
{
auto desc = Value::Helper::desc(val);
auto store = Value::Helper::store(val);
assert(desc && desc->code==TypeCode::Struct);
assert(!mask || mask->size()==desc->size());
BitMask valid(desc->size());
for(auto bit : range(desc->size())) {
if((store.get()+bit)->valid)
if((store.get()+bit)->valid && (!mask || (*mask)[bit]))
valid[bit] = true;
}