File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,10 @@ impl Pool {
5151
5252 let mut buf = self . store . pop_buf_or_create ( ) ;
5353
54- serialize ( msg, & mut buf) ?;
55- let resp_header = self . comm_stream ( node_uid, & mut buf, true ) . await ?;
54+ let msg_len = serialize ( msg, & mut buf) ?;
55+ let resp_header = self
56+ . comm_stream ( node_uid, & mut buf[ 0 ..msg_len] , true )
57+ . await ?;
5658 let resp_msg = deserialize_body ( & resp_header, & buf[ Header :: LEN ..] ) ?;
5759
5860 self . store . push_buf ( buf) ;
@@ -68,8 +70,9 @@ impl Pool {
6870
6971 let mut buf = self . store . pop_buf_or_create ( ) ;
7072
71- serialize ( msg, & mut buf) ?;
72- self . comm_stream ( node_uid, & mut buf, false ) . await ?;
73+ let msg_len = serialize ( msg, & mut buf) ?;
74+ self . comm_stream ( node_uid, & mut buf[ 0 ..msg_len] , false )
75+ . await ?;
7376
7477 self . store . push_buf ( buf) ;
7578
You can’t perform that action at this time.
0 commit comments