1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-11 14:25:57 +03:00

move ratelim to its own crate

This commit is contained in:
Wez Furlong 2020-10-02 17:31:39 -07:00
parent 6893adbc34
commit 5fc1227fb9
8 changed files with 24 additions and 6 deletions

10
Cargo.lock generated
View File

@ -2825,6 +2825,14 @@ dependencies = [
"num",
]
[[package]]
name = "ratelim"
version = "0.1.0"
dependencies = [
"config",
"ratelimit_meter",
]
[[package]]
name = "ratelimit_meter"
version = "5.0.0"
@ -4107,7 +4115,7 @@ dependencies = [
"promise",
"pulldown-cmark",
"rangeset",
"ratelimit_meter",
"ratelim",
"rcgen",
"regex",
"serde",

View File

@ -56,7 +56,7 @@ openssl = "0.10"
palette = "0.5"
portable-pty = { path = "pty", features = ["serde_support", "ssh"]}
promise = { path = "promise" }
ratelimit_meter = "5.0"
ratelim= { path = "ratelim" }
rcgen = "0.7"
http_req = {version="0.6", default-features=false, features=["rust-tls"]}
regex = "1"

11
ratelim/Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "ratelim"
version = "0.1.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ratelimit_meter = "5.0"
config = { path = "../config" }

View File

@ -22,7 +22,6 @@ use config::keyassignment;
mod localtab;
mod markdown;
mod mux;
mod ratelim;
mod server;
mod ssh;
mod stats;

View File

@ -1,11 +1,11 @@
use crate::mux::pane::{Pane, PaneId};
use crate::mux::tab::{Tab, TabId};
use crate::mux::window::{Window, WindowId};
use crate::ratelim::RateLimiter;
use anyhow::{anyhow, Error};
use domain::{Domain, DomainId};
use log::error;
use portable_pty::ExitStatus;
use ratelim::RateLimiter;
use std::cell::{Ref, RefCell, RefMut};
use std::collections::HashMap;
use std::io::Read;

View File

@ -2,7 +2,6 @@ use crate::mux::domain::DomainId;
use crate::mux::pane::{alloc_pane_id, Pane, PaneId, Pattern, SearchResult};
use crate::mux::renderable::{Renderable, RenderableDimensions};
use crate::mux::tab::TabId;
use crate::ratelim::RateLimiter;
use crate::server::codec::*;
use crate::server::domain::ClientInner;
use crate::server::tab::mousestate::MouseState;
@ -13,6 +12,7 @@ use config::configuration;
use filedescriptor::Pipe;
use log::info;
use portable_pty::PtySize;
use ratelim::RateLimiter;
use std::cell::RefCell;
use std::cell::RefMut;
use std::rc::Rc;

View File

@ -1,7 +1,6 @@
use crate::mux::renderable::{Renderable, RenderableDimensions, StableCursorPosition};
use crate::mux::tab::TabId;
use crate::mux::Mux;
use crate::ratelim::RateLimiter;
use crate::server::codec::*;
use crate::server::domain::ClientInner;
use crate::server::tab::clienttab::ClientPane;
@ -10,6 +9,7 @@ use config::{configuration, ConfigHandle};
use lru::LruCache;
use promise::BrokenPromise;
use rangeset::*;
use ratelim::RateLimiter;
use std::cell::RefCell;
use std::ops::Range;
use std::sync::atomic::{AtomicBool, Ordering};