Files
hmq/vendor/gopkg.in/jcmturner/rpc.v1/ndr/pipe.go
T
joy.zhou c6b1f1db42 Plugins support (#46)
* modify

* update

* add acl

* add feature

* update dockerfile

* add deploy

* update

* update

* plugins

* plugins

* update

* update

* update

* fixed

* remove

* fixed

* add log

* update

* fixed

* update

* fix config

* add http api

* add http api

* resp

* add config for work chan

* update

* fixed

* update

* disable trace

* fixed

* change acl

* fixed

* fixed res

* dd

* dd

* ddd

* dd

* update

* fixed

* update

* add

* fixed

* update key

* add log

* update

* format

* update

* update auth

* update

* update readme

* added

* update

* fixed

* fixed

* fix

* upade

* update

* update
2019-07-25 13:54:42 +08:00

32 lines
716 B
Go

package ndr
import (
"fmt"
"reflect"
)
func (dec *Decoder) fillPipe(v reflect.Value, tag reflect.StructTag) error {
s, err := dec.readUint32() // read element count of first chunk
if err != nil {
return err
}
a := reflect.MakeSlice(v.Type(), 0, 0)
c := reflect.MakeSlice(v.Type(), int(s), int(s))
for s != 0 {
for i := 0; i < int(s); i++ {
err := dec.fill(c.Index(i), tag, &[]deferedPtr{})
if err != nil {
return fmt.Errorf("could not fill element %d of pipe: %v", i, err)
}
}
s, err = dec.readUint32() // read element count of first chunk
if err != nil {
return err
}
a = reflect.AppendSlice(a, c)
c = reflect.MakeSlice(v.Type(), int(s), int(s))
}
v.Set(a)
return nil
}