Skip to content

Commit

Permalink
metalinter
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Sep 6, 2016
1 parent cdee7df commit fdc1712
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 1 addition & 3 deletions crypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ func (c *SimpleXORBlockCrypt) Encrypt(dst, src []byte) { xorBytes(dst, src, c.xo
func (c *SimpleXORBlockCrypt) Decrypt(dst, src []byte) { xorBytes(dst, src, c.xortbl) }

// NoneBlockCrypt simple returns the plaintext
type NoneBlockCrypt struct {
xortbl []byte
}
type NoneBlockCrypt struct{}

// NewNoneBlockCrypt initate by the given key
func NewNoneBlockCrypt(key []byte) (BlockCrypt, error) {
Expand Down
16 changes: 9 additions & 7 deletions kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,33 +134,35 @@ func NewSegment(size int) *Segment {
type KCP struct {
conv, mtu, mss, state uint32
snd_una, snd_nxt, rcv_nxt uint32
ts_recent, ts_lastack, ssthresh uint32
ssthresh uint32
rx_rttval, rx_srtt, rx_rto, rx_minrto uint32
snd_wnd, rcv_wnd, rmt_wnd, cwnd, probe uint32
current, interval, ts_flush, xmit uint32
nodelay, updated uint32
ts_probe, probe_wait uint32
dead_link, incr uint32

fastresend int32
nocwnd, stream int32

snd_queue []Segment
rcv_queue []Segment
snd_buf []Segment
rcv_buf []Segment

acklist ACKList

buffer []byte
fastresend int32
nocwnd, stream int32
logmask int32
output Output
buffer []byte
output Output
}

// ACK packet to return
type ACK struct {
sn uint32
ts uint32
}

// ACKList is heapified
type ACKList []ACK

func (l ACKList) Len() int { return len(l) }
Expand Down Expand Up @@ -348,7 +350,7 @@ func (kcp *KCP) Send(buffer []byte) int {

// https://tools.ietf.org/html/rfc6298
func (kcp *KCP) update_ack(rtt int32) {
var rto uint32 = 0
var rto uint32
if kcp.rx_srtt == 0 {
kcp.rx_srtt = uint32(rtt)
kcp.rx_rttval = uint32(rtt) / 2
Expand Down

0 comments on commit fdc1712

Please sign in to comment.