Skip to content

Commit a14810b

Browse files
authored
Bump quic-go (#241)
* Bump inet.af/netaddr * Bump quic-go * Remove unnecessary time.Duration * Formatting changes to please linter * Adapt to changes in quic http3 types * Add nolint:contextcheck in some places * Formatting changes in _examples dir too * Comment out ifshort linter to avoid deprecation warning * Revert duplicating comments * Bump golangci version in setup_lint in Makefile * Mention new Go version requirement in README * Bump Go version in CI build task * Bump machine and Go version in CI integration task * Try building SCION and scion-apps with different versions of Go * Try again, placing Go where I have permission * Try again... * Try the other way around, using old machine image, but newer Go for scion-apps
1 parent 4f4e37c commit a14810b

File tree

34 files changed

+260
-169
lines changed

34 files changed

+260
-169
lines changed

.circleci/config.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: cimg/go:1.17
5+
- image: cimg/go:1.20
66
steps:
77
- run:
88
name: Go version
@@ -92,6 +92,13 @@ jobs:
9292
name: Install libpam0g-dev
9393
command:
9494
sudo apt-get update && sudo apt-get install -y libpam0g-dev
95+
# Use different Go version to build scion-apps
96+
- run:
97+
name: Install Go 1.20.7 to build scion-apps
98+
command: |
99+
wget https://go.dev/dl/go1.20.7.linux-amd64.tar.gz
100+
sudo rm -rf /usr/local/go
101+
sudo tar -C /usr/local -xzf go1.20.7.linux-amd64.tar.gz
95102
- run:
96103
name: Integration tests
97104
command: |

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ linters:
2424
- exportloopref
2525
- gci
2626
- gofmt
27-
- ifshort
27+
#- ifshort
2828
- importas
2929
- makezero
3030
- misspell

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test:
3838

3939
setup_lint:
4040
@# Install golangci-lint (as dumb as this looks, this is the recommended way to install)
41-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${DESTDIR} v1.43.0
41+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${DESTDIR} v1.53.3
4242

4343
lint:
4444
@type golangci-lint > /dev/null || ( echo "golangci-lint not found. Install it manually or by running 'make setup_lint'."; exit 1 )

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sudo apt install scion-apps-*
1717

1818
### Build:
1919

20-
1. Install go 1.16
20+
1. Install Go. We currently support Go versions 1.19 and 1.20.
2121

2222
See e.g. https://github.com/golang/go/wiki/Ubuntu
2323

_examples/.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ linters:
2424
- exportloopref
2525
- gci
2626
- gofmt
27-
- ifshort
27+
#- ifshort
2828
- importas
2929
- makezero
3030
- misspell
@@ -47,4 +47,4 @@ linters-settings:
4747
default-signifies-exhaustive: true
4848

4949
run:
50-
build-tags: integration
50+
build-tags: integration

_examples/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ go 1.16
55
require (
66
github.com/golang/protobuf v1.5.2
77
github.com/gorilla/handlers v1.5.1
8-
github.com/lucas-clemente/quic-go v0.23.0
98
github.com/netsec-ethz/scion-apps v0.5.1-0.20220504120040-79211109ed3f
9+
github.com/quic-go/quic-go v0.34.0
1010
github.com/scionproto/scion v0.6.1-0.20220202161514-5883c725f748
1111
google.golang.org/grpc v1.40.0
12-
google.golang.org/protobuf v1.27.1
12+
google.golang.org/protobuf v1.28.0
1313
inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a
1414
)
1515

_examples/go.sum

Lines changed: 65 additions & 19 deletions
Large diffs are not rendered by default.

_examples/helloquic/helloquic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"os"
2525
"time"
2626

27-
"github.com/lucas-clemente/quic-go"
2827
"github.com/netsec-ethz/scion-apps/pkg/pan"
2928
"github.com/netsec-ethz/scion-apps/pkg/quicutil"
29+
"github.com/quic-go/quic-go"
3030
"inet.af/netaddr"
3131
)
3232

@@ -80,7 +80,7 @@ func runServer(listen netaddr.IPPort) error {
8080
}
8181
}
8282

83-
func workSession(session quic.Session) error {
83+
func workSession(session quic.Connection) error {
8484
for {
8585
stream, err := session.AcceptStream(context.Background())
8686
if err != nil {

_examples/sgrpc/client/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"net"
1010
"time"
1111

12-
"github.com/lucas-clemente/quic-go"
1312
"github.com/netsec-ethz/scion-apps/pkg/pan"
1413
"github.com/netsec-ethz/scion-apps/pkg/quicutil"
14+
"github.com/quic-go/quic-go"
1515
"google.golang.org/grpc"
1616
"google.golang.org/grpc/credentials/insecure"
1717
"inet.af/netaddr"
@@ -31,7 +31,7 @@ func NewPanQuicDialer(tlsCfg *tls.Config) func(context.Context, string) (net.Con
3131
return nil, err
3232
}
3333

34-
clientQuicConfig := &quic.Config{KeepAlive: true}
34+
clientQuicConfig := &quic.Config{KeepAlivePeriod: 15 * time.Second}
3535
session, err := pan.DialQUIC(ctx, netaddr.IPPort{}, panAddr, nil, nil, "", tlsCfg, clientQuicConfig)
3636
if err != nil {
3737
return nil, fmt.Errorf("did not dial: %w", err)

bwtester/bwtestserver/bwtestserver.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ func startBwtestBackground(serverCCAddr pan.UDPAddr, clientCCAddr pan.UDPAddr,
180180

181181
// writeResponseN writes the response to an 'N' (new bandwidth test) request.
182182
// The waitTime field is
183-
// - 0: Ok, the test starts immediately
184-
// - N>0: please try again in N seconds
183+
// - 0: Ok, the test starts immediately
184+
// - N>0: please try again in N seconds
185185
func writeResponseN(ccConn net.PacketConn, addr net.Addr, waitTime byte) {
186186
var response [2]byte
187187
response[0] = 'N'
@@ -191,9 +191,9 @@ func writeResponseN(ccConn net.PacketConn, addr net.Addr, waitTime byte) {
191191

192192
// writeResponseN writes the response to an 'R' (fetch results) request.
193193
// The code field is
194-
// - 0: Ok, the rest of the response is the encoded result
195-
// - N>0: please try again in N seconds
196-
// - 127: error, go away (why 127? I guess we have 7-bit bytes or something...)
194+
// - 0: Ok, the rest of the response is the encoded result
195+
// - N>0: please try again in N seconds
196+
// - 127: error, go away (why 127? I guess we have 7-bit bytes or something...)
197197
func writeResponseR(ccConn net.PacketConn, addr net.Addr, code byte, res *bwtest.Result) {
198198
response := make([]byte, 2000)
199199
response[0] = 'R'

0 commit comments

Comments
 (0)