mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 16:23:28 +03:00
committed by
Harshavardhana
parent
664ff063a1
commit
8e6e9301ce
+21
@@ -0,0 +1,21 @@
|
||||
package sarama
|
||||
|
||||
import "fmt"
|
||||
|
||||
type responseHeader struct {
|
||||
length int32
|
||||
correlationID int32
|
||||
}
|
||||
|
||||
func (r *responseHeader) decode(pd packetDecoder) (err error) {
|
||||
r.length, err = pd.getInt32()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if r.length <= 4 || r.length > MaxResponseSize {
|
||||
return PacketDecodingError{fmt.Sprintf("message of length %d too large or too small", r.length)}
|
||||
}
|
||||
|
||||
r.correlationID, err = pd.getInt32()
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user