[edge] Reload and share links: in-process config swap with self-reverting trials, admin socket with health and certificate status, share-link cookies, visitor pages and throttle
This commit is contained in:
@@ -197,10 +197,10 @@ pub fn start_edge(env: &Env, name: &'static str, config_text: &str) -> Target {
|
||||
cfg.http_listen.parse().unwrap(),
|
||||
cfg.https_listen.parse().unwrap(),
|
||||
);
|
||||
let rt = Arc::new(
|
||||
ianitor_edge::runtime::build(cfg, Some(&env.dir.join("creds"))).expect("edge runtime"),
|
||||
);
|
||||
let server = ianitor_edge::server(rt, &ianitor_edge::Options::default()).expect("edge server");
|
||||
let rt = ianitor_edge::runtime::build(cfg, Some(&env.dir.join("creds"))).expect("edge runtime");
|
||||
let opts = ianitor_edge::Options::default();
|
||||
let shared = ianitor_edge::shared_for(rt, &opts);
|
||||
let server = ianitor_edge::server(shared, &opts).expect("edge server");
|
||||
let (tx, rx) = tokio::sync::oneshot::channel();
|
||||
std::thread::spawn(move || ianitor_edge::run_until(server, rx));
|
||||
assert!(
|
||||
|
||||
@@ -52,12 +52,13 @@ pub fn parse_response(raw: &[u8]) -> io::Result<Resp> {
|
||||
{
|
||||
let mut out = Vec::new();
|
||||
let mut rest = &body[..];
|
||||
loop {
|
||||
let Some(p) = rest.windows(2).position(|w| w == b"\r\n") else {
|
||||
break;
|
||||
};
|
||||
while let Some(p) = rest.windows(2).position(|w| w == b"\r\n") {
|
||||
let size = usize::from_str_radix(
|
||||
String::from_utf8_lossy(&rest[..p]).split(';').next().unwrap_or("0").trim(),
|
||||
String::from_utf8_lossy(&rest[..p])
|
||||
.split(';')
|
||||
.next()
|
||||
.unwrap_or("0")
|
||||
.trim(),
|
||||
16,
|
||||
)
|
||||
.map_err(other)?;
|
||||
|
||||
Reference in New Issue
Block a user