|
@@ -17,7 +17,13 @@ type DescribeLogDirsRequestTopic struct {
|
|
|
}
|
|
|
|
|
|
func (r *DescribeLogDirsRequest) encode(pe packetEncoder) error {
|
|
|
- if err := pe.putArrayLength(len(r.DescribeTopics)); err != nil {
|
|
|
+ length := len(r.DescribeTopics)
|
|
|
+ if length == 0 {
|
|
|
+
|
|
|
+ length = -1
|
|
|
+ }
|
|
|
+
|
|
|
+ if err := pe.putArrayLength(length); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
|
|
@@ -39,6 +45,9 @@ func (r *DescribeLogDirsRequest) decode(pd packetDecoder, version int16) error {
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
+ if n == -1 {
|
|
|
+ n = 0
|
|
|
+ }
|
|
|
|
|
|
topics := make([]DescribeLogDirsRequestTopic, n)
|
|
|
for i := 0; i < n; i++ {
|