Skip to content

Commit

Permalink
Use patched ws-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejhirsz committed Sep 17, 2020
1 parent db92ed1 commit bb9ac8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jsonrpc-server-utils = { version = "14.2", path = "../server-utils" }
log = "0.4"
parking_lot = "0.10.0"
slab = "0.4"
ws = "0.9"
parity-ws = "0.10"

[badges]
travis-ci = { repository = "paritytech/jsonrpc", branch = "master"}
2 changes: 1 addition & 1 deletion ws/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use jsonrpc_server_utils as server_utils;

pub use jsonrpc_core;
pub use ws;
pub use parity_ws as ws;

#[macro_use]
extern crate log;
Expand Down
2 changes: 2 additions & 0 deletions ws/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ impl Server {
config.max_connections = max_connections;
// don't accept super large requests
config.max_fragment_size = max_payload_bytes;
config.max_in_buffer_capacity = max_payload_bytes;
config.max_out_buffer_capacity = max_payload_bytes;
// don't grow non-final fragments (to prevent DOS)
config.fragments_grow = false;
config.fragments_capacity = cmp::max(1, max_payload_bytes / config.fragment_size);
Expand Down

0 comments on commit bb9ac8e

Please sign in to comment.