v1.0.1
FIX: * Cleaned up some documentation
This commit is contained in:
@@ -90,7 +90,7 @@ func (r *Response) MarshalBinary() (data []byte, err error) {
|
||||
msgSize += i.Size()
|
||||
}
|
||||
|
||||
// The message "body" - we do this first so we can checksum .
|
||||
// The message "body" - this is done first so it can be checksummed.
|
||||
if _, err = msgBuf.Write(hdrBODYSTART); err != nil {
|
||||
return
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func (r *Response) MarshalBinary() (data []byte, err error) {
|
||||
hasErr = true
|
||||
}
|
||||
|
||||
// Now we write the response as a whole.
|
||||
// Now write the response as a whole.
|
||||
|
||||
// Status
|
||||
if r.Status == RespStatusByteOK && hasErr {
|
||||
@@ -130,7 +130,7 @@ func (r *Response) MarshalBinary() (data []byte, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Checksum -- ALWAYS present for responses!
|
||||
// Checksum; ALWAYS present for responses!
|
||||
if _, _, err = r.GenChecksum(); err != nil {
|
||||
return
|
||||
}
|
||||
@@ -426,7 +426,7 @@ func (r *Response) UnmarshalBinary(data []byte) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// Now that we've validated the checksum, we trim the msgBuf to only RGs.
|
||||
// Now that the checksum has validated, trim the msgBuf to only RGs.
|
||||
// Skip over the BODYSTART, record group count, and record group size.
|
||||
if _, err = msgBuf.Read(make([]byte, len(hdrBODYSTART)+(PackedNumSize*2))); err != nil {
|
||||
return
|
||||
@@ -439,7 +439,7 @@ func (r *Response) UnmarshalBinary(data []byte) (err error) {
|
||||
for idx := 0; idx < rgCnt; idx++ {
|
||||
rgBuf = new(bytes.Buffer)
|
||||
|
||||
// The RG unmarshaler handles the record count, but we need to read it into msgBuf.
|
||||
// The RG unmarshaler handles the record count, but it needs to be in msgBuf to do that.
|
||||
if _, err = io.CopyN(rgBuf, msgBuf, int64(PackedNumSize)); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user