File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
rs-tproxy-controller/src/proxy Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl<T: serde::ser::Serialize> UdsDataServer<T> {
30
30
loop {
31
31
match ( & listener) . accept ( ) . await {
32
32
Ok ( ( mut stream, addr) ) => {
33
- let buf = bincode :: serialize ( & self . data ) ?;
33
+ let buf = serde_json :: to_vec ( & self . data ) ?;
34
34
tokio:: spawn ( async move {
35
35
return match stream. write_all ( buf. as_slice ( ) ) . await {
36
36
Ok ( _) => {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ pub async fn apply_request_action(
99
99
append_queries ( request. uri_mut ( ) , patch. queries . as_ref ( ) ) ?;
100
100
if let Some ( patch_body) = & patch. body {
101
101
let PatchBodyActionContents :: JSON ( ref value) = patch_body. contents ;
102
- let mut data = read_value ( & mut request. body_mut ( ) ) . await ?;
102
+ let mut data = read_value ( request. body_mut ( ) ) . await ?;
103
103
json_patch:: merge ( & mut data, value) ;
104
104
let merged = serde_json:: to_vec ( & data) ?;
105
105
* request. body_mut ( ) = merged. into ( ) ;
@@ -216,7 +216,7 @@ pub async fn apply_response_action(
216
216
if let Some ( patch) = & actions. patch {
217
217
if let Some ( patch_body) = & patch. body {
218
218
let PatchBodyActionContents :: JSON ( ref value) = patch_body. contents ;
219
- let mut data = read_value ( & mut response. body_mut ( ) ) . await ?;
219
+ let mut data = read_value ( response. body_mut ( ) ) . await ?;
220
220
json_patch:: merge ( & mut data, value) ;
221
221
let merged = serde_json:: to_vec ( & data) ?;
222
222
* response. body_mut ( ) = merged. into ( ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ impl UdsDataClient {
23
23
Ok ( _) => {
24
24
tracing:: debug!( "Read data successfully." ) ;
25
25
26
- match bincode :: deserialize ( buf. as_slice ( ) ) {
26
+ match serde_json :: from_slice ( buf. as_slice ( ) ) {
27
27
Ok ( o) => {
28
28
tracing:: debug!( "Deserialize data successfully." ) ;
29
29
Ok ( o)
You can’t perform that action at this time.
0 commit comments