Skip to content

Commit

Permalink
Use patched ws-rs (#584)
Browse files Browse the repository at this point in the history
* Use patched ws-rs

* Update settings

* Bump versions to 16.0.0
  • Loading branch information
maciejhirsz authored Sep 18, 2020
1 parent b165fac commit 92e3c14
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 45 deletions.
4 changes: 2 additions & 2 deletions core-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"]
license = "MIT"
name = "jsonrpc-core-client"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

categories = [
"asynchronous",
Expand All @@ -26,7 +26,7 @@ ipc = ["jsonrpc-client-transports/ipc", "futures01"]
arbitrary_precision = ["jsonrpc-client-transports/arbitrary_precision"]

[dependencies]
jsonrpc-client-transports = { version = "15.0", path = "./transports", default-features = false }
jsonrpc-client-transports = { version = "16.0", path = "./transports", default-features = false }
# Only for client transports, should be removed when we fully transition to futures=0.3
futures01 = { version = "0.1", package = "futures", optional = true }
futures = { version = "0.3", features = [ "compat" ] }
Expand Down
12 changes: 6 additions & 6 deletions core-client/transports/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"]
license = "MIT"
name = "jsonrpc-client-transports"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

categories = [
"asynchronous",
Expand Down Expand Up @@ -38,8 +38,8 @@ arbitrary_precision = ["serde_json/arbitrary_precision", "jsonrpc-core/arbitrary
[dependencies]
derive_more = "0.99"
futures = { version = "0.3", features = [ "compat" ] }
jsonrpc-core = { version = "15.0", path = "../../core" }
jsonrpc-pubsub = { version = "15.0", path = "../../pubsub" }
jsonrpc-core = { version = "16.0", path = "../../core" }
jsonrpc-pubsub = { version = "16.0", path = "../../pubsub" }
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -48,15 +48,15 @@ url = "1.7"
futures01 = { version = "0.1.26", package = "futures", optional = true }
hyper = { version = "0.12", optional = true }
hyper-tls = { version = "0.3.2", optional = true }
jsonrpc-server-utils = { version = "15.0", path = "../../server-utils", optional = true }
jsonrpc-server-utils = { version = "16.0", path = "../../server-utils", optional = true }
parity-tokio-ipc = { version = "0.2", optional = true }
tokio = { version = "0.1", optional = true }
websocket = { version = "0.24", optional = true }

[dev-dependencies]
assert_matches = "1.1"
jsonrpc-http-server = { version = "15.0", path = "../../http" }
jsonrpc-ipc-server = { version = "15.0", path = "../../ipc" }
jsonrpc-http-server = { version = "16.0", path = "../../http" }
jsonrpc-ipc-server = { version = "16.0", path = "../../ipc" }
lazy_static = "1.0"
env_logger = "0.7"

Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"]
license = "MIT"
name = "jsonrpc-core"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

categories = [
"asynchronous",
Expand Down
10 changes: 5 additions & 5 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = "https://github.com/paritytech/jsonrpc"
license = "MIT"
name = "jsonrpc-derive"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[lib]
proc-macro = true
Expand All @@ -20,10 +20,10 @@ proc-macro-crate = "0.1.4"

[dev-dependencies]
assert_matches = "1.3"
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-core-client = { version = "15.0", path = "../core-client" }
jsonrpc-pubsub = { version = "15.0", path = "../pubsub" }
jsonrpc-tcp-server = { version = "15.0", path = "../tcp" }
jsonrpc-core = { version = "16.0", path = "../core" }
jsonrpc-core-client = { version = "16.0", path = "../core-client" }
jsonrpc-pubsub = { version = "16.0", path = "../pubsub" }
jsonrpc-tcp-server = { version = "16.0", path = "../tcp" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
trybuild = "1.0"
6 changes: 3 additions & 3 deletions http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "server"]
license = "MIT"
name = "jsonrpc-http-server"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
futures01 = { version = "0.1", package = "futures" }
futures03 = { version = "0.3", package = "futures", features = ["compat"] }
hyper = "0.12"
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-server-utils = { version = "15.0", path = "../server-utils" }
jsonrpc-core = { version = "16.0", path = "../core" }
jsonrpc-server-utils = { version = "16.0", path = "../server-utils" }
log = "0.4"
net2 = "0.2"
parking_lot = "0.10.0"
Expand Down
6 changes: 3 additions & 3 deletions ipc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ homepage = "https://github.com/paritytech/jsonrpc"
license = "MIT"
name = "jsonrpc-ipc-server"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
futures01 = { version = "0.1", package = "futures" }
futures03 = { version = "0.3", package = "futures", features = [ "compat" ] }
log = "0.4"
tokio-service = "0.1"
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-server-utils = { version = "15.0", path = "../server-utils" }
jsonrpc-core = { version = "16.0", path = "../core" }
jsonrpc-server-utils = { version = "16.0", path = "../server-utils" }
parity-tokio-ipc = "0.4"
parking_lot = "0.10.0"

Expand Down
6 changes: 3 additions & 3 deletions pubsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "macros"]
license = "MIT"
name = "jsonrpc-pubsub"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
futures = { version = "0.3", features = ["thread-pool"] }
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-core = { version = "16.0", path = "../core" }
lazy_static = "1.4"
log = "0.4"
parking_lot = "0.11.0"
rand = "0.7"
serde = "1.0"

[dev-dependencies]
jsonrpc-tcp-server = { version = "15.0", path = "../tcp" }
jsonrpc-tcp-server = { version = "16.0", path = "../tcp" }

[badges]
travis-ci = { repository = "paritytech/jsonrpc", branch = "master"}
10 changes: 5 additions & 5 deletions pubsub/more-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "jsonrpc-pubsub-examples"
description = "Examples of Publish-Subscribe extension for jsonrpc."
homepage = "https://github.com/paritytech/jsonrpc"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"
authors = ["tomusdrw <tomasz@parity.io>"]
license = "MIT"

[dependencies]
jsonrpc-core = { version = "15.0", path = "../../core" }
jsonrpc-pubsub = { version = "15.0", path = "../" }
jsonrpc-ws-server = { version = "15.0", path = "../../ws" }
jsonrpc-ipc-server = { version = "15.0", path = "../../ipc" }
jsonrpc-core = { version = "16.0", path = "../../core" }
jsonrpc-pubsub = { version = "16.0", path = "../" }
jsonrpc-ws-server = { version = "16.0", path = "../../ws" }
jsonrpc-ipc-server = { version = "16.0", path = "../../ipc" }
4 changes: 2 additions & 2 deletions server-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"]
license = "MIT"
name = "jsonrpc-server-utils"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
bytes = "0.4"
futures01 = { version = "0.1", package = "futures" }
globset = "0.4"
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-core = { version = "16.0", path = "../core" }
lazy_static = "1.1.0"
log = "0.4"
tokio = { version = "0.1.15" }
Expand Down
4 changes: 2 additions & 2 deletions stdio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ homepage = "https://github.com/paritytech/jsonrpc"
license = "MIT"
name = "jsonrpc-stdio-server"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
futures = { version = "0.3", features = [ "compat" ] }
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-core = { version = "16.0", path = "../core" }
log = "0.4"
tokio = "0.1.7"
tokio-codec = "0.1.0"
Expand Down
6 changes: 3 additions & 3 deletions tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ homepage = "https://github.com/paritytech/jsonrpc"
license = "MIT"
name = "jsonrpc-tcp-server"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
futures01 = { version = "0.1", package = "futures" }
# TODO remove when we no longer need compat (use jsonrpc-core re-export instead)
futures03 = { version = "0.3", features = ["compat"], package = "futures" }
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-server-utils = { version = "15.0", path = "../server-utils" }
jsonrpc-core = { version = "16.0", path = "../core" }
jsonrpc-server-utils = { version = "16.0", path = "../server-utils" }
log = "0.4"
parking_lot = "0.10.0"
tokio-service = "0.1"
Expand Down
10 changes: 5 additions & 5 deletions test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "jsonrpc-test"
description = "Simple test framework for JSON-RPC."
version = "15.0.0"
version = "16.0.0"
authors = ["Tomasz Drwięga <tomasz@parity.io>"]
license = "MIT"
homepage = "https://github.com/paritytech/jsonrpc"
Expand All @@ -10,9 +10,9 @@ documentation = "https://docs.rs/jsonrpc-test/"
edition = "2018"

[dependencies]
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-core-client = { version = "15.0", path = "../core-client" }
jsonrpc-pubsub = { version = "15.0", path = "../pubsub" }
jsonrpc-core = { version = "16.0", path = "../core" }
jsonrpc-core-client = { version = "16.0", path = "../core-client" }
jsonrpc-pubsub = { version = "16.0", path = "../pubsub" }
log = "0.4"
serde = "1.0"
serde_json = "1.0"
Expand All @@ -21,5 +21,5 @@ serde_json = "1.0"
arbitrary_precision = ["jsonrpc-core-client/arbitrary_precision", "serde_json/arbitrary_precision", "jsonrpc-core/arbitrary_precision"]

[dev-dependencies]
jsonrpc-derive = { version = "15.0", path = "../derive" }
jsonrpc-derive = { version = "16.0", path = "../derive" }

8 changes: 4 additions & 4 deletions ws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ homepage = "https://github.com/paritytech/jsonrpc"
license = "MIT"
name = "jsonrpc-ws-server"
repository = "https://github.com/paritytech/jsonrpc"
version = "15.0.0"
version = "16.0.0"

[dependencies]
futures01 = { version = "0.1", package = "futures" }
futures03 = { version = "0.3", package = "futures", features = [ "compat" ] }
jsonrpc-core = { version = "15.0", path = "../core" }
jsonrpc-server-utils = { version = "15.0", path = "../server-utils" }
jsonrpc-core = { version = "16.0", path = "../core" }
jsonrpc-server-utils = { version = "16.0", 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 @@ -68,6 +68,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 92e3c14

Please sign in to comment.