merge develop into master #21

Merged
JakeHillion merged 149 commits from develop into master 2021-05-12 00:22:59 +01:00
4 changed files with 19 additions and 7 deletions
Showing only changes of commit 929707ce97 - Show all commits

View File

@ -1,8 +1,14 @@
---
kind: pipeline kind: pipeline
type: docker type: docker
name: default name: default
steps: steps:
- name: format
image: golang:1.15
commands:
- bash -c "gofmt -l . | wc -l | cmp -s <(echo 0) || (gofmt -l . && exit 1)"
- name: install - name: install
image: golang:1.15 image: golang:1.15
environment: environment:
@ -47,4 +53,10 @@ steps:
volumes: volumes:
- name: cache - name: cache
temp: {} temp: { }
---
kind: signature
hmac: 8c21312bcfbaa9b7d2d3c31b1a5c13b54b4ecd1da853aa66a8ed11d72154fcca
...

View File

@ -25,7 +25,7 @@ type Peer struct {
RemoteHost string `validate:"required_with=RemotePort,omitempty,fqdn|ip"` RemoteHost string `validate:"required_with=RemotePort,omitempty,fqdn|ip"`
RemotePort uint `validate:"required_with=RemoteHost,omitempty,max=65535"` RemotePort uint `validate:"required_with=RemoteHost,omitempty,max=65535"`
Congestion string `validate:"oneof=NewReno None"` Congestion string `validate:"required_unless=Method TCP,omitempty,oneof=NewReno None"`
KeepAlive uint KeepAlive uint
Timeout uint Timeout uint

View File

@ -17,8 +17,8 @@ type NewReno struct {
keepalive chan bool keepalive chan bool
outboundTimes, inboundTimes map[uint32]time.Time outboundTimes, inboundTimes map[uint32]time.Time
outboundTimesLock sync.Mutex outboundTimesLock sync.Mutex
inboundTimesLock sync.RWMutex inboundTimesLock sync.RWMutex
ack, lastAck uint32 ack, lastAck uint32
nack, lastNack uint32 nack, lastNack uint32
@ -34,7 +34,7 @@ type NewReno struct {
lastSent time.Time lastSent time.Time
hasAcked bool hasAcked bool
acksToSend utils.Uint32Heap acksToSend utils.Uint32Heap
acksToSendLock sync.Mutex acksToSendLock sync.Mutex
} }

View File

@ -33,7 +33,7 @@ func TestUnmarshalPacket(t *testing.T) {
data: proxy.SimplePacket(testContent), data: proxy.SimplePacket(testContent),
} }
testMarshalled := testPacket.Marshal() testMarshalled := testPacket.Marshal()
t.Run("Length", func(t *testing.T) { t.Run("Length", func(t *testing.T) {
p, err := UnmarshalPacket(testMarshalled) p, err := UnmarshalPacket(testMarshalled)
@ -47,7 +47,7 @@ func TestUnmarshalPacket(t *testing.T) {
require.Nil(t, err) require.Nil(t, err)
assert.Equal(t, p.Contents(), testContent) assert.Equal(t, p.Contents(), testContent)
}) })
t.Run("Header", func(t *testing.T) { t.Run("Header", func(t *testing.T) {
p, err := UnmarshalPacket(testMarshalled) p, err := UnmarshalPacket(testMarshalled)
require.Nil(t, err) require.Nil(t, err)