Skip to content

Commit

Permalink
- fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau committed Jun 9, 2023
1 parent 1405694 commit 94ba35e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 3 additions & 6 deletions integrationTests/peerConnections/peerConnections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func TestPeerConnectionsOnAllSupportedProtocolsShouldExchangeData(t *testing.T)
require.Nil(t, err)
addressToConnect = getAddressMatching(seeder.Addresses(), "/quic-v1/", "")
err = webTransportPeer.ConnectToPeer(addressToConnect)
fmt.Println(webTransportPeer.ID().Pretty())
require.Nil(t, err)

// create a common topic on all messengers
Expand Down Expand Up @@ -150,11 +149,9 @@ func TestPeerConnectionsOnAllSupportedProtocolsShouldExchangeData(t *testing.T)

mutMessages.Unlock()

defer func() {
for _, mes := range messengers {
_ = mes.Close()
}
}()
for _, mes := range messengers {
_ = mes.Close()
}
}

func getAddressMatching(addresses []string, including string, excluding string) string {
Expand Down
8 changes: 4 additions & 4 deletions libp2p/netMessenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@ func parseTransportOptions(configs config.TransportConfig, port int) ([]libp2p.O
}
}

quickAddress := configs.QUICAddress
if len(quickAddress) > 0 {
if !strictCheckStringForIntMarkup(quickAddress) {
quicAddress := configs.QUICAddress
if len(quicAddress) > 0 {
if !strictCheckStringForIntMarkup(quicAddress) {
return nil, nil, p2p.ErrInvalidQUICAddress
}

addresses = append(addresses, fmt.Sprintf(quickAddress, port))
addresses = append(addresses, fmt.Sprintf(quicAddress, port))
options = append(options, libp2p.Transport(quic.NewTransport))
}

Expand Down
2 changes: 1 addition & 1 deletion libp2p/netMessenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,7 @@ func TestParseTransportOptions(t *testing.T) {
assert.Equal(t, "/ip4/127.0.0.1/tcp/100", addresses[0])
assert.Nil(t, err)
})
t.Run("without port reuse, should work", func(t *testing.T) {
t.Run("with port reuse, should work", func(t *testing.T) {
options, addresses, err := libp2p.ParseTransportOptions(
config.TransportConfig{
TCP: config.TCPProtocolConfig{
Expand Down

0 comments on commit 94ba35e

Please sign in to comment.