@@ -5,6 +5,7 @@ use crate::frame::{
5
5
} ;
6
6
use crate :: { RequestOpcode , TargetShard } ;
7
7
use bytes:: Bytes ;
8
+ use compression:: no_compression;
8
9
use scylla_cql:: frame:: types:: read_string_multimap;
9
10
use std:: collections:: HashMap ;
10
11
use std:: fmt:: Display ;
@@ -815,6 +816,7 @@ impl Doorkeeper {
815
816
FrameOpcode :: Request ( RequestOpcode :: Options ) ,
816
817
& Bytes :: new ( ) ,
817
818
connection,
819
+ & no_compression ( )
818
820
)
819
821
. await
820
822
. map_err ( DoorkeeperError :: ObtainingShardNumber ) ?;
@@ -1123,7 +1125,7 @@ impl ProxyWorker {
1123
1125
driver_addr,
1124
1126
& response. opcode
1125
1127
) ;
1126
- if response. write ( & mut write_half) . await . is_err ( ) {
1128
+ if response. write ( & mut write_half, & compression ) . await . is_err ( ) {
1127
1129
if terminate_notifier. try_recv ( ) . is_err ( )
1128
1130
&& connection_close_notifier. try_recv ( ) . is_err ( )
1129
1131
{
@@ -1172,7 +1174,7 @@ impl ProxyWorker {
1172
1174
& request. opcode
1173
1175
) ;
1174
1176
1175
- if request. write ( & mut write_half) . await . is_err ( ) {
1177
+ if request. write ( & mut write_half, & compression ) . await . is_err ( ) {
1176
1178
if terminate_notifier. try_recv ( ) . is_err ( )
1177
1179
&& connection_close_notifier. try_recv ( ) . is_err ( )
1178
1180
{
@@ -1486,6 +1488,7 @@ mod tests {
1486
1488
FrameOpcode :: Response ( ResponseOpcode :: Supported ) ,
1487
1489
& body,
1488
1490
conn,
1491
+ & no_compression ( ) ,
1489
1492
)
1490
1493
. await
1491
1494
. unwrap ( ) ;
@@ -1552,7 +1555,7 @@ mod tests {
1552
1555
let send_frame_to_shard = async {
1553
1556
let mut conn = TcpStream :: connect ( node1_proxy_addr) . await . unwrap ( ) ;
1554
1557
1555
- write_frame ( params, opcode, & body, & mut conn) . await . unwrap ( ) ;
1558
+ write_frame ( params, opcode, & body, & mut conn, & no_compression ( ) ) . await . unwrap ( ) ;
1556
1559
conn
1557
1560
} ;
1558
1561
@@ -1787,13 +1790,13 @@ mod tests {
1787
1790
let send_frame_to_shard = async {
1788
1791
let mut conn = TcpStream :: connect ( node1_proxy_addr) . await . unwrap ( ) ;
1789
1792
1790
- write_frame ( params1, opcode1, & body1, & mut conn)
1793
+ write_frame ( params1, opcode1, & body1, & mut conn, & no_compression ( ) )
1791
1794
. await
1792
1795
. unwrap ( ) ;
1793
- write_frame ( params2, opcode2, & body2, & mut conn)
1796
+ write_frame ( params2, opcode2, & body2, & mut conn, & no_compression ( ) )
1794
1797
. await
1795
1798
. unwrap ( ) ;
1796
- write_frame ( params3, opcode3, & body3, & mut conn)
1799
+ write_frame ( params3, opcode3, & body3, & mut conn, & no_compression ( ) )
1797
1800
. await
1798
1801
. unwrap ( ) ;
1799
1802
@@ -1889,7 +1892,7 @@ mod tests {
1889
1892
body : & Bytes ,
1890
1893
) -> Result < RequestFrame , ReadFrameError > {
1891
1894
let ( send_res, recv_res) = join (
1892
- write_frame ( params, opcode, & body. clone ( ) , driver) ,
1895
+ write_frame ( params, opcode, & body. clone ( ) , driver, & no_compression ( ) ) ,
1893
1896
read_request_frame ( node, & no_compression ( ) ) ,
1894
1897
)
1895
1898
. await ;
@@ -2004,7 +2007,7 @@ mod tests {
2004
2007
body : & Bytes ,
2005
2008
) -> Result < RequestFrame , ReadFrameError > {
2006
2009
let ( send_res, recv_res) = join (
2007
- write_frame ( params, opcode, & body. clone ( ) , driver) ,
2010
+ write_frame ( params, opcode, & body. clone ( ) , driver, & no_compression ( ) ) ,
2008
2011
read_request_frame ( node, & no_compression ( ) ) ,
2009
2012
)
2010
2013
. await ;
@@ -2081,15 +2084,15 @@ mod tests {
2081
2084
2082
2085
let send_frame_to_shard = async {
2083
2086
let mut conn = TcpStream :: connect ( node1_proxy_addr) . await . unwrap ( ) ;
2084
- write_frame ( params, request_opcode, & body, & mut conn)
2087
+ write_frame ( params, request_opcode, & body, & mut conn, & no_compression ( ) )
2085
2088
. await
2086
2089
. unwrap ( ) ;
2087
2090
conn
2088
2091
} ;
2089
2092
2090
2093
let mock_node_action = async {
2091
2094
let ( mut conn, _) = mock_node_listener. accept ( ) . await . unwrap ( ) ;
2092
- write_frame ( params. for_response ( ) , response_opcode, & body, & mut conn)
2095
+ write_frame ( params. for_response ( ) , response_opcode, & body, & mut conn, & no_compression ( ) )
2093
2096
. await
2094
2097
. unwrap ( ) ;
2095
2098
conn
@@ -2211,10 +2214,10 @@ mod tests {
2211
2214
let send_frame_to_shard = async {
2212
2215
let mut conn = TcpStream :: connect ( node1_proxy_addr) . await . unwrap ( ) ;
2213
2216
2214
- write_frame ( params1, opcode1, & body1, & mut conn)
2217
+ write_frame ( params1, opcode1, & body1, & mut conn, & no_compression ( ) )
2215
2218
. await
2216
2219
. unwrap ( ) ;
2217
- write_frame ( params2, opcode2, & body2, & mut conn)
2220
+ write_frame ( params2, opcode2, & body2, & mut conn, & no_compression ( ) )
2218
2221
. await
2219
2222
. unwrap ( ) ;
2220
2223
conn
@@ -2262,7 +2265,7 @@ mod tests {
2262
2265
2263
2266
let mut conn = TcpStream :: connect ( node1_proxy_addr) . await . unwrap ( ) ;
2264
2267
2265
- write_frame ( params, opcode, & body, & mut conn) . await . unwrap ( ) ;
2268
+ write_frame ( params, opcode, & body, & mut conn, & no_compression ( ) ) . await . unwrap ( ) ;
2266
2269
// We assert that after sufficiently long time, no error happens inside proxy.
2267
2270
tokio:: time:: sleep ( Duration :: from_millis ( 3 ) ) . await ;
2268
2271
running_proxy. finish ( ) . await . unwrap ( ) ;
@@ -2340,13 +2343,13 @@ mod tests {
2340
2343
2341
2344
let mut conn = TcpStream :: connect ( node1_proxy_addr) . await . unwrap ( ) ;
2342
2345
2343
- write_frame ( params1, opcode1, & body1, & mut conn)
2346
+ write_frame ( params1, opcode1, & body1, & mut conn, & no_compression ( ) )
2344
2347
. await
2345
2348
. unwrap ( ) ;
2346
- write_frame ( params2, opcode2, & body2, & mut conn)
2349
+ write_frame ( params2, opcode2, & body2, & mut conn, & no_compression ( ) )
2347
2350
. await
2348
2351
. unwrap ( ) ;
2349
- write_frame ( params3, opcode3, & body3, & mut conn)
2352
+ write_frame ( params3, opcode3, & body3, & mut conn, & no_compression ( ) )
2350
2353
. await
2351
2354
. unwrap ( ) ;
2352
2355
@@ -2453,7 +2456,7 @@ mod tests {
2453
2456
let socket = bind_socket_for_shard ( shards_count, driver_shard) . await ;
2454
2457
let mut conn = socket. connect ( node_proxy_addr) . await . unwrap ( ) ;
2455
2458
2456
- write_frame ( params, request_opcode, body_ref, & mut conn)
2459
+ write_frame ( params, request_opcode, body_ref, & mut conn, & no_compression ( ) )
2457
2460
. await
2458
2461
. unwrap ( ) ;
2459
2462
conn
@@ -2473,7 +2476,7 @@ mod tests {
2473
2476
& no_compression ( ) ,
2474
2477
)
2475
2478
. await ;
2476
- write_frame ( params. for_response ( ) , response_opcode, body_ref, & mut conn)
2479
+ write_frame ( params. for_response ( ) , response_opcode, body_ref, & mut conn, & no_compression ( ) )
2477
2480
. await
2478
2481
. unwrap ( ) ;
2479
2482
conn
@@ -2583,6 +2586,7 @@ mod tests {
2583
2586
FrameOpcode :: Request ( req_opcode) ,
2584
2587
( body_base. to_string ( ) + "|request|" ) . as_bytes ( ) ,
2585
2588
client_socket_ref,
2589
+ & no_compression ( )
2586
2590
)
2587
2591
. await
2588
2592
. unwrap ( ) ;
@@ -2598,6 +2602,7 @@ mod tests {
2598
2602
FrameOpcode :: Response ( resp_opcode) ,
2599
2603
( body_base. to_string ( ) + "|response|" ) . as_bytes ( ) ,
2600
2604
server_socket_ref,
2605
+ & no_compression ( )
2601
2606
)
2602
2607
. await
2603
2608
. unwrap ( ) ;
0 commit comments