Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Feb 21, 2025
1 parent e75c7e3 commit 402b274
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions p2p/transport/webrtc/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (t *WebRTCTransport) listenSocket(socket net.PacketConn) (tpt.Listener, err
if err != nil {
return nil, err
}
listenerMultiaddr = listenerMultiaddr.EncapsulateC(webrtcComponent).EncapsulateC(certComp)
listenerMultiaddr = append(listenerMultiaddr, webrtcComponent, certComp)

return newListener(
t,
Expand Down Expand Up @@ -531,7 +531,7 @@ func (t *WebRTCTransport) AddCertHashes(addr ma.Multiaddr) (ma.Multiaddr, bool)
if err != nil {
return nil, false
}
return addr.EncapsulateC(certComp), true
return append(addr, certComp), true
}

type netConnWrapper struct {
Expand Down
6 changes: 3 additions & 3 deletions p2p/transport/websocket/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ type listener struct {

func (pwma *parsedWebsocketMultiaddr) toMultiaddr() ma.Multiaddr {
if !pwma.isWSS {
return pwma.restMultiaddr.EncapsulateC(wsComponent)
return append(pwma.restMultiaddr, wsComponent)
}

if pwma.sni.Empty() {
return pwma.restMultiaddr.EncapsulateC(tlsComponent).EncapsulateC(wsComponent)
return append(pwma.restMultiaddr, tlsComponent, wsComponent)
}

return pwma.restMultiaddr.EncapsulateC(tlsComponent).EncapsulateC(pwma.sni).EncapsulateC(wsComponent)
return append(append(pwma.restMultiaddr, tlsComponent), pwma.sni, wsComponent...)

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-check / All

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-check / All

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-check / All

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-test / ubuntu (go 1.23.x)

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-test / ubuntu (go 1.24.x)

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-test / macos (go 1.23.x)

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-test / macos (go 1.24.x)

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-test / windows (go 1.23.x)

too many arguments in call to append

Check failure on line 50 in p2p/transport/websocket/listener.go

View workflow job for this annotation

GitHub Actions / go-test / windows (go 1.24.x)

too many arguments in call to append
}

// newListener creates a new listener from a raw net.Listener.
Expand Down
4 changes: 0 additions & 4 deletions p2p/transport/webtransport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,6 @@ func TestFlowControlWindowIncrease(t *testing.T) {
addr = addr.Encapsulate(ma.StringCast(fmt.Sprintf("/udp/%d", proxy.LocalPort())))
continue
}
if addr == nil {
addr = append(addr, comp)
continue
}
addr = append(addr, comp)
}

Expand Down

0 comments on commit 402b274

Please sign in to comment.