Remove 64 device limit

This commit is contained in:
Audrius Butkevicius 2014-10-20 21:45:26 +01:00
parent c618eba9a9
commit ec9d68960f
2 changed files with 3 additions and 9 deletions

View File

@ -138,7 +138,7 @@ func (o *ClusterConfigMessage) GetOption(key string) string {
type Folder struct {
ID string // max:64
Devices []Device // max:64
Devices []Device
}
type Device struct {

View File

@ -644,7 +644,7 @@ Folder Structure:
struct Folder {
string ID<64>;
Device Devices<64>;
Device Devices<>;
}
*/
@ -670,9 +670,6 @@ func (o Folder) encodeXDR(xw *xdr.Writer) (int, error) {
return xw.Tot(), xdr.ErrElementSizeExceeded
}
xw.WriteString(o.ID)
if len(o.Devices) > 64 {
return xw.Tot(), xdr.ErrElementSizeExceeded
}
xw.WriteUint32(uint32(len(o.Devices)))
for i := range o.Devices {
_, err := o.Devices[i].encodeXDR(xw)
@ -697,9 +694,6 @@ func (o *Folder) UnmarshalXDR(bs []byte) error {
func (o *Folder) decodeXDR(xr *xdr.Reader) error {
o.ID = xr.ReadStringMax(64)
_DevicesSize := int(xr.ReadUint32())
if _DevicesSize > 64 {
return xdr.ErrElementSizeExceeded
}
o.Devices = make([]Device, _DevicesSize)
for i := range o.Devices {
(&o.Devices[i]).decodeXDR(xr)