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> {
3030 loop {
3131 match ( & listener) . accept ( ) . await {
3232 Ok ( ( mut stream, addr) ) => {
33- let buf = bincode :: serialize ( & self . data ) ?;
33+ let buf = serde_json :: to_vec ( & self . data ) ?;
3434 tokio:: spawn ( async move {
3535 return match stream. write_all ( buf. as_slice ( ) ) . await {
3636 Ok ( _) => {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ pub async fn apply_request_action(
9999 append_queries ( request. uri_mut ( ) , patch. queries . as_ref ( ) ) ?;
100100 if let Some ( patch_body) = & patch. body {
101101 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 ?;
103103 json_patch:: merge ( & mut data, value) ;
104104 let merged = serde_json:: to_vec ( & data) ?;
105105 * request. body_mut ( ) = merged. into ( ) ;
@@ -216,7 +216,7 @@ pub async fn apply_response_action(
216216 if let Some ( patch) = & actions. patch {
217217 if let Some ( patch_body) = & patch. body {
218218 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 ?;
220220 json_patch:: merge ( & mut data, value) ;
221221 let merged = serde_json:: to_vec ( & data) ?;
222222 * response. body_mut ( ) = merged. into ( ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ impl UdsDataClient {
2323 Ok ( _) => {
2424 tracing:: debug!( "Read data successfully." ) ;
2525
26- match bincode :: deserialize ( buf. as_slice ( ) ) {
26+ match serde_json :: from_slice ( buf. as_slice ( ) ) {
2727 Ok ( o) => {
2828 tracing:: debug!( "Deserialize data successfully." ) ;
2929 Ok ( o)
You can’t perform that action at this time.
0 commit comments