Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use patched ws-rs #583

Merged
merged 3 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I thought that maybe it's too little, but the default 5MB for this should be more than enough for a bunch of requests.

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