Session migration (#319)
* migrate between nodes * session migration * bug fix * use version instead of query parameter * clean code * clean * merge master * solve comments * solve comment * update go.mod Co-authored-by: cnderrauber <zengjie9004@gmail.com>
This commit is contained in:
co-authored by
cnderrauber
parent
ecf9590d56
commit
8582ca4c9b
@@ -2,6 +2,7 @@ package buffer
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"math"
|
||||
)
|
||||
|
||||
@@ -94,7 +95,7 @@ func (b *Bucket) get(sn uint16) []byte {
|
||||
|
||||
func (b *Bucket) set(sn uint16, pkt []byte) ([]byte, error) {
|
||||
if b.headSN-sn >= uint16(b.maxSteps+1) {
|
||||
return nil, ErrPacketTooOld
|
||||
return nil, fmt.Errorf("%w, headSN %d, sn %d", ErrPacketTooOld, b.headSN, sn)
|
||||
}
|
||||
pos := b.step - int(b.headSN-sn+1)
|
||||
if pos < 0 {
|
||||
|
||||
Reference in New Issue
Block a user