diff options
author | Yuchen Wu <[email protected]> | 2024-06-28 15:13:50 -0700 |
---|---|---|
committer | Yuchen Wu <[email protected]> | 2024-07-12 11:24:29 -0700 |
commit | 0035064d047d5e89ff10e96f8befa087a0b1b1a0 (patch) | |
tree | 09c3d684475e68a10bd3115416131369093652b0 | |
parent | cdefa5c431b907ce1030066172d49744856c1189 (diff) | |
download | pingora-0035064d047d5e89ff10e96f8befa087a0b1b1a0.tar.gz pingora-0035064d047d5e89ff10e96f8befa087a0b1b1a0.zip |
Provide a group key for connection reuse isolation
-rw-r--r-- | .bleep | 2 | ||||
-rw-r--r-- | pingora-core/src/upstreams/peer.rs | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -1 +1 @@ -d295eb585fee737413583b185f82fc2fd46f1d50
\ No newline at end of file +c8b3190a76c824a4f6aa6631f65d49e67f3aaf7d
\ No newline at end of file diff --git a/pingora-core/src/upstreams/peer.rs b/pingora-core/src/upstreams/peer.rs index 7c0277c..78e59ed 100644 --- a/pingora-core/src/upstreams/peer.rs +++ b/pingora-core/src/upstreams/peer.rs @@ -403,6 +403,9 @@ pub struct HttpPeer { pub sni: String, pub proxy: Option<Proxy>, pub client_cert_key: Option<Arc<CertKey>>, + /// a custom field to isolate connection reuse. Requests with different group keys + /// cannot share connections with each other. + pub group_key: u64, pub options: PeerOptions, } @@ -422,6 +425,7 @@ impl HttpPeer { sni, proxy: None, client_cert_key: None, + group_key: 0, options: PeerOptions::new(), } } @@ -462,6 +466,7 @@ impl HttpPeer { headers, }), client_cert_key: None, + group_key: 0, options: PeerOptions::new(), } } @@ -485,6 +490,7 @@ impl Hash for HttpPeer { self.verify_cert().hash(state); self.verify_hostname().hash(state); self.alternative_cn().hash(state); + self.group_key.hash(state); } } |