From 9f9fcb1f1c165beb9158cae4054a65defb865798 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Mon, 24 Jul 2023 12:02:31 +0200 Subject: [PATCH] adapt new websocket config struct --- plugins/authenticator/tsconfig.json | 5 ++++- plugins/autostart/tsconfig.json | 5 ++++- plugins/fs-extra/tsconfig.json | 5 ++++- plugins/fs-watch/tsconfig.json | 5 ++++- plugins/log/tsconfig.json | 5 ++++- plugins/positioner/tsconfig.json | 5 ++++- plugins/sql/tsconfig.json | 5 ++++- plugins/store/tsconfig.json | 5 ++++- plugins/stronghold/tsconfig.json | 5 ++++- plugins/upload/tsconfig.json | 5 ++++- plugins/websocket/src/lib.rs | 11 +++++++++-- plugins/websocket/tsconfig.json | 5 ++++- plugins/window-state/tsconfig.json | 5 ++++- shared/template/tsconfig.json | 5 ++++- 14 files changed, 61 insertions(+), 15 deletions(-) mode change 120000 => 100644 plugins/authenticator/tsconfig.json mode change 120000 => 100644 plugins/autostart/tsconfig.json mode change 120000 => 100644 plugins/fs-extra/tsconfig.json mode change 120000 => 100644 plugins/fs-watch/tsconfig.json mode change 120000 => 100644 plugins/log/tsconfig.json mode change 120000 => 100644 plugins/positioner/tsconfig.json mode change 120000 => 100644 plugins/sql/tsconfig.json mode change 120000 => 100644 plugins/store/tsconfig.json mode change 120000 => 100644 plugins/stronghold/tsconfig.json mode change 120000 => 100644 plugins/upload/tsconfig.json mode change 120000 => 100644 plugins/websocket/tsconfig.json mode change 120000 => 100644 plugins/window-state/tsconfig.json mode change 120000 => 100644 shared/template/tsconfig.json diff --git a/plugins/authenticator/tsconfig.json b/plugins/authenticator/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/authenticator/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/authenticator/tsconfig.json b/plugins/authenticator/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/authenticator/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/autostart/tsconfig.json b/plugins/autostart/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/autostart/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/autostart/tsconfig.json b/plugins/autostart/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/autostart/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/fs-extra/tsconfig.json b/plugins/fs-extra/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/fs-extra/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/fs-extra/tsconfig.json b/plugins/fs-extra/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/fs-extra/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/fs-watch/tsconfig.json b/plugins/fs-watch/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/fs-watch/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/fs-watch/tsconfig.json b/plugins/fs-watch/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/fs-watch/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/log/tsconfig.json b/plugins/log/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/log/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/log/tsconfig.json b/plugins/log/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/log/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/positioner/tsconfig.json b/plugins/positioner/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/positioner/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/positioner/tsconfig.json b/plugins/positioner/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/positioner/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/sql/tsconfig.json b/plugins/sql/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/sql/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/sql/tsconfig.json b/plugins/sql/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/sql/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/store/tsconfig.json b/plugins/store/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/store/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/store/tsconfig.json b/plugins/store/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/store/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/stronghold/tsconfig.json b/plugins/stronghold/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/stronghold/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/stronghold/tsconfig.json b/plugins/stronghold/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/stronghold/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/upload/tsconfig.json b/plugins/upload/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/upload/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/upload/tsconfig.json b/plugins/upload/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/upload/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/websocket/src/lib.rs b/plugins/websocket/src/lib.rs index 55676e12..a26f6ae2 100644 --- a/plugins/websocket/src/lib.rs +++ b/plugins/websocket/src/lib.rs @@ -45,7 +45,8 @@ struct ConnectionManager(Mutex>); #[derive(Default, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ConnectionConfig { - pub max_send_queue: Option, + pub write_buffer_size: Option, + pub max_write_buffer_size: Option, pub max_message_size: Option, pub max_frame_size: Option, pub accept_unmasked_frames: bool, @@ -53,9 +54,15 @@ pub struct ConnectionConfig { impl From for WebSocketConfig { fn from(config: ConnectionConfig) -> Self { + // Disabling the warning on max_send_queue which we don't use anymore since it was deprecated. + #[allow(deprecated)] Self { - max_send_queue: config.max_send_queue, + max_send_queue: None, + write_buffer_size: config.write_buffer_size.unwrap_or(128 * 1024), + max_write_buffer_size: config.max_write_buffer_size.unwrap_or(usize::MAX), + // This may be harmful since if it's not provided from js we're overwriting the default value with None, meaning no size limit. max_message_size: config.max_message_size, + // This may be harmful since if it's not provided from js we're overwriting the default value with None, meaning no size limit. max_frame_size: config.max_frame_size, accept_unmasked_frames: config.accept_unmasked_frames, } diff --git a/plugins/websocket/tsconfig.json b/plugins/websocket/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/websocket/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/websocket/tsconfig.json b/plugins/websocket/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/websocket/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/window-state/tsconfig.json b/plugins/window-state/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/window-state/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/window-state/tsconfig.json b/plugins/window-state/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/window-state/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/shared/template/tsconfig.json b/shared/template/tsconfig.json deleted file mode 120000 index 4ec6ff6a..00000000 --- a/shared/template/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../tsconfig.json \ No newline at end of file diff --git a/shared/template/tsconfig.json b/shared/template/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/shared/template/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +}