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 {
51
51
52
52
let mut buf = self . store . pop_buf_or_create ( ) ;
53
53
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 ?;
56
58
let resp_msg = deserialize_body ( & resp_header, & buf[ Header :: LEN ..] ) ?;
57
59
58
60
self . store . push_buf ( buf) ;
@@ -68,8 +70,9 @@ impl Pool {
68
70
69
71
let mut buf = self . store . pop_buf_or_create ( ) ;
70
72
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 ?;
73
76
74
77
self . store . push_buf ( buf) ;
75
78
You can’t perform that action at this time.
0 commit comments