Skip to content

Commit 389257f

Browse files
committed
websocket: Use substream open timeout for protocol negotiations
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
1 parent 897cbae commit 389257f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/transport/websocket/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl WebSocketTransport {
147147
let connection_open_timeout = self.config.connection_open_timeout;
148148
let max_read_ahead_factor = self.config.noise_read_ahead_frame_count;
149149
let max_write_buffer_size = self.config.noise_write_buffer_size;
150+
let substream_open_timeout = self.config.substream_open_timeout;
150151
let address = Multiaddr::empty()
151152
.with(Protocol::from(address.ip()))
152153
.with(Protocol::Tcp(address.port()))
@@ -162,6 +163,7 @@ impl WebSocketTransport {
162163
yamux_config,
163164
max_read_ahead_factor,
164165
max_write_buffer_size,
166+
substream_open_timeout,
165167
)
166168
.await
167169
.map_err(|error| (connection_id, error.into()))
@@ -342,6 +344,7 @@ impl Transport for WebSocketTransport {
342344
let connection_open_timeout = self.config.connection_open_timeout;
343345
let max_read_ahead_factor = self.config.noise_read_ahead_frame_count;
344346
let max_write_buffer_size = self.config.noise_write_buffer_size;
347+
let substream_open_timeout = self.config.substream_open_timeout;
345348
let dial_addresses = self.dial_addresses.clone();
346349
let nodelay = self.config.nodelay;
347350

@@ -369,6 +372,7 @@ impl Transport for WebSocketTransport {
369372
yamux_config,
370373
max_read_ahead_factor,
371374
max_write_buffer_size,
375+
substream_open_timeout,
372376
)
373377
.await
374378
.map_err(|error| (connection_id, error.into()))
@@ -536,6 +540,7 @@ impl Transport for WebSocketTransport {
536540
let max_read_ahead_factor = self.config.noise_read_ahead_frame_count;
537541
let max_write_buffer_size = self.config.noise_write_buffer_size;
538542
let connection_open_timeout = self.config.connection_open_timeout;
543+
let substream_open_timeout = self.config.substream_open_timeout;
539544
let keypair = self.context.keypair.clone();
540545

541546
tracing::trace!(
@@ -559,6 +564,7 @@ impl Transport for WebSocketTransport {
559564
yamux_config,
560565
max_read_ahead_factor,
561566
max_write_buffer_size,
567+
substream_open_timeout,
562568
)
563569
.await
564570
.map_err(|error| (connection_id, error.into()))

0 commit comments

Comments
 (0)