v1.14.0
ADDED: * iox package * mapsx package * netx/inetcksum package
This commit is contained in:
@@ -22,7 +22,7 @@ func (i *InetChecksum) Aligned() (aligned bool) {
|
||||
defer i.alignLock.Unlock()
|
||||
|
||||
i.bufLock.RLock()
|
||||
aligned = i.buf.Len()&2 == 0
|
||||
aligned = i.buf.Len()%2 == 0
|
||||
i.bufLock.RUnlock()
|
||||
|
||||
i.aligned = aligned
|
||||
@@ -113,7 +113,7 @@ func (i *InetChecksum) Reset() {
|
||||
i.sumLock.Lock()
|
||||
i.lastLock.Lock()
|
||||
|
||||
i.aligned = false
|
||||
i.aligned = true
|
||||
i.alignLock.Unlock()
|
||||
|
||||
i.buf.Reset()
|
||||
@@ -308,7 +308,7 @@ func (i *InetChecksum) WriteByte(c byte) (err error) {
|
||||
}
|
||||
|
||||
if !i.disabledBuf {
|
||||
if err = i.WriteByte(c); err != nil {
|
||||
if err = i.buf.WriteByte(c); err != nil {
|
||||
i.sum = origSum
|
||||
i.aligned = origAligned
|
||||
i.last = origLast
|
||||
|
||||
Reference in New Issue
Block a user