Skip to content

Commit

Permalink
rename func to ReserveBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Mar 22, 2019
1 parent 83e13d2 commit 4149bfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ func (kcp *KCP) delSegment(seg *segment) {
}
}

// KeepHead keeps n bytes untouched from the beginning of the buffer
// ReserveBytes keeps n bytes untouched from the beginning of the buffer
// the output_callback function should be aware of this
// return false if n >= mss
func (kcp *KCP) KeepHead(n int) bool {
func (kcp *KCP) ReserveBytes(n int) bool {
if n >= int(kcp.mtu-IKCP_OVERHEAD) || n < 0 {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func newUDPSession(conv uint32, dataShards, parityShards int, l *Listener, conn
}
})
sess.kcp.SetMtu(IKCP_MTU_DEF - sess.headerSize)
sess.kcp.KeepHead(sess.headerSize)
sess.kcp.ReserveBytes(sess.headerSize)

// register current session to the global updater,
// which call sess.update() periodically.
Expand Down

0 comments on commit 4149bfc

Please sign in to comment.