proc/variables: fill Len field of maps when recursion limit is reached (#834)

If we don't fill the Len field there will be no way for the user to
distinguish maps we didn't load from empty maps.
This commit is contained in:
Alessandro Arzilli
2017-05-30 23:26:10 +02:00
committed by Derek Parker
parent a4df01e105
commit d8bb8ed5bf
3 changed files with 11 additions and 1 deletions

View File

@ -824,6 +824,9 @@ func (v *Variable) loadValueInternal(recurseLevel int, cfg LoadConfig) {
case reflect.Map:
if recurseLevel <= cfg.MaxVariableRecurse {
v.loadMap(recurseLevel, cfg)
} else {
// loads length so that the client knows that the map isn't empty
v.mapIterator()
}
case reflect.String: