@@ -38,13 +38,20 @@ use {
3838 tokio:: sync:: oneshot:: Sender ,
3939} ;
4040
41+ const REGION_NONE : & [ u8 ] = b"none" ;
42+
4143/// Data specific to an individual request, including any host-side
4244/// allocations on behalf of the guest processing the request.
4345pub struct Session {
4446 /// The downstream IP address and port for this session.
4547 downstream_client_addr : SocketAddr ,
4648 /// The IP address and port that received this session.
4749 downstream_server_addr : SocketAddr ,
50+ /// The compliance region that this request was received in.
51+ ///
52+ /// For now this is just always `"none"`, but we place the field in the session
53+ /// to make it easier to implement custom configuration values later on.
54+ downstream_compliance_region : Vec < u8 > ,
4855 /// Handle for the downstream request "parts". NB the backing parts data can be mutated
4956 /// or even removed from the relevant map.
5057 downstream_req_handle : RequestHandle ,
@@ -165,6 +172,7 @@ impl Session {
165172 Session {
166173 downstream_server_addr : server_addr,
167174 downstream_client_addr : client_addr,
175+ downstream_compliance_region : Vec :: from ( REGION_NONE ) ,
168176 downstream_req_handle,
169177 downstream_req_body_handle,
170178 downstream_req_original_headers,
@@ -204,6 +212,11 @@ impl Session {
204212 self . downstream_server_addr . ip ( )
205213 }
206214
215+ /// Retrieve the compliance region that received the request for this session.
216+ pub fn downstream_compliance_region ( & self ) -> & [ u8 ] {
217+ self . downstream_compliance_region . as_slice ( )
218+ }
219+
207220 /// Retrieve the handle corresponding to the downstream request.
208221 pub fn downstream_request ( & self ) -> RequestHandle {
209222 self . downstream_req_handle
0 commit comments