diff --git a/p2p/transport/webrtc/connection.go b/p2p/transport/webrtc/connection.go index 7b0fe78d86..5a0a8fc5f3 100644 --- a/p2p/transport/webrtc/connection.go +++ b/p2p/transport/webrtc/connection.go @@ -28,8 +28,6 @@ var _ tpt.CapableConn = &connection{} // maxAcceptQueueLen is the number of waiting streams. const maxAcceptQueueLen = 256 -const maxDataChannelID = 1 << 10 - type errConnectionTimeout struct{} var _ net.Error = &errConnectionTimeout{} @@ -195,12 +193,6 @@ func (c *connection) OpenStream(ctx context.Context) (network.MuxedStream, error if id > math.MaxUint16 { return nil, errors.New("exhausted stream ID space") } - // Limit the number of streams, since we're not able to actually properly close them. - // See https://github.com/libp2p/specs/issues/575 for details. - if id > maxDataChannelID { - c.Close() - return c.OpenStream(ctx) - } streamID := uint16(id) dc, err := c.pc.CreateDataChannel("", &webrtc.DataChannelInit{ID: &streamID}) @@ -329,12 +321,6 @@ func (c *connection) setRemotePublicKey(key ic.PubKey) { func SetupDataChannelQueue(pc *webrtc.PeerConnection, queueLen int) chan DetachedDataChannel { queue := make(chan DetachedDataChannel, queueLen) pc.OnDataChannel(func(dc *webrtc.DataChannel) { - // Limit the number of streams, since we're not able to actually properly close them. - // See https://github.com/libp2p/specs/issues/575 for details. - if *dc.ID() > maxDataChannelID { - dc.Close() - return - } dc.OnOpen(func() { rwc, err := dc.Detach() if err != nil {