From e8e733046ca2f2ed0855a6ed07df3015dbe0cc75 Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Tue, 27 Apr 2021 22:36:44 -0500 Subject: [PATCH] :pencil: docs: trying to figure how I can keep the client stream open --- crates/ptth_relay/src/relay_state.rs | 6 ++++-- docs/explanation/protocol.md | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/ptth_relay/src/relay_state.rs b/crates/ptth_relay/src/relay_state.rs index 8dd85f0..a66892e 100644 --- a/crates/ptth_relay/src/relay_state.rs +++ b/crates/ptth_relay/src/relay_state.rs @@ -77,11 +77,13 @@ impl Default for ServerStatus { pub struct Relay { pub (crate) config: RwLock , - // Key: Server ID + /// The parked clients or parked server, keyed by server + pub (crate) request_rendezvous: Mutex >, pub (crate) server_status: Mutex >, - // Key: Request ID + /// The parked requests, keyed by request ID + pub (crate) response_rendezvous: RwLock >, pub (crate) shutdown_watch_tx: watch::Sender , diff --git a/docs/explanation/protocol.md b/docs/explanation/protocol.md index bba9bfd..7e5d8ec 100644 --- a/docs/explanation/protocol.md +++ b/docs/explanation/protocol.md @@ -67,7 +67,7 @@ HTTP/1.1 200 OK [ { - "id": "JOZC7VRA", + "id": "01F4B61CQF1GY39BM5H24SR9H3", "req": { "method": "GET", "uri": "/files", @@ -84,7 +84,7 @@ Step 4 doesn't involve any HTTP. Step 5, server to relay: ```text -POST /7ZSFUKGV/http_response/JOZC7VRA http/1.1 +POST /7ZSFUKGV/http_response/01F4B61CQF1GY39BM5H24SR9H3 http/1.1 Host: example.com X-PTTH-2LJYXWC4: ZXhhbXBsZSB0ZXh0IGdvZXMgaGVyZQo= Content-Length: 2400