You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
437 B
22 lines
437 B
8 years ago
|
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
|
||
|
}
|