File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ pub enum TargetSessionAttrs {
34
34
Any ,
35
35
/// The session must allow writes.
36
36
ReadWrite ,
37
+ /// The session allow only reads.
38
+ ReadOnly ,
37
39
}
38
40
39
41
/// TLS configuration.
@@ -622,6 +624,7 @@ impl Config {
622
624
let target_session_attrs = match value {
623
625
"any" => TargetSessionAttrs :: Any ,
624
626
"read-write" => TargetSessionAttrs :: ReadWrite ,
627
+ "read-only" => TargetSessionAttrs :: ReadOnly ,
625
628
_ => {
626
629
return Err ( Error :: config_parse ( Box :: new ( InvalidValue (
627
630
"target_session_attrs" ,
Original file line number Diff line number Diff line change @@ -34,6 +34,14 @@ fn settings() {
34
34
. keepalives_idle ( Duration :: from_secs ( 30 ) )
35
35
. target_session_attrs ( TargetSessionAttrs :: ReadWrite ) ,
36
36
) ;
37
+ check (
38
+ "connect_timeout=3 keepalives=0 keepalives_idle=30 target_session_attrs=read-only" ,
39
+ Config :: new ( )
40
+ . connect_timeout ( Duration :: from_secs ( 3 ) )
41
+ . keepalives ( false )
42
+ . keepalives_idle ( Duration :: from_secs ( 30 ) )
43
+ . target_session_attrs ( TargetSessionAttrs :: ReadOnly ) ,
44
+ ) ;
37
45
}
38
46
39
47
#[ test]
You can’t perform that action at this time.
0 commit comments