@@ -28,7 +28,11 @@ func (s *Stream) Close() error {
2828 s .wer .Put (io .ErrClosedPipe )
2929 s .zo0 .Do (func () {
3030 s .mux .pri .Pri (0 , func () error {
31- s .mux .con .Write ([]byte {0x02 , s .idx , 0x00 , 0x00 })
31+ mph := make ([]byte , 4 )
32+ mph [0 ] = 0x02
33+ mph [1 ] = s .idx
34+ mph [2 ] = 0x00
35+ s .mux .con .Write (mph )
3236 return nil
3337 })
3438 })
@@ -41,7 +45,11 @@ func (s *Stream) Esolc() error {
4145 s .wer .Put (io .ErrClosedPipe )
4246 s .zo0 .Do (func () {
4347 s .mux .pri .Pri (0 , func () error {
44- s .mux .con .Write ([]byte {0x02 , s .idx , 0x01 , 0x00 })
48+ mph := make ([]byte , 4 )
49+ mph [0 ] = 0x02
50+ mph [1 ] = s .idx
51+ mph [2 ] = 0x01
52+ s .mux .con .Write (mph )
4553 return nil
4654 })
4755 })
@@ -177,7 +185,10 @@ func (m *Mux) Open() (*Stream, error) {
177185 return nil , err
178186 }
179187 err = m .pri .Pri (0 , func () error {
180- return doa .Err (m .con .Write ([]byte {0x00 , idx , 0x00 , 0x00 }))
188+ mph := make ([]byte , 4 )
189+ mph [0 ] = 0x00
190+ mph [1 ] = idx
191+ return doa .Err (m .con .Write (mph ))
181192 })
182193 if err != nil {
183194 m .idp .Put (idx )
@@ -200,7 +211,10 @@ func (m *Mux) Recv() {
200211 old * Stream
201212 prb = time .AfterFunc (Conf .IdleProbeDuration , func () {
202213 if m .pri .Pri (0 , func () error {
203- return doa .Err (m .con .Write ([]byte {0x03 , 0x00 , 0x00 , 0x00 }))
214+ mph := make ([]byte , 4 )
215+ mph [0 ] = 0x03
216+ mph [1 ] = 0x00
217+ return doa .Err (m .con .Write (mph ))
204218 }) != nil {
205219 m .Close ()
206220 }
@@ -262,7 +276,10 @@ func (m *Mux) Recv() {
262276 switch idx {
263277 case 0x00 :
264278 m .pri .Pri (0 , func () error {
265- return doa .Err (m .con .Write ([]byte {0x03 , 0x01 , 0x00 , 0x00 }))
279+ mph := make ([]byte , 4 )
280+ mph [0 ] = 0x03
281+ mph [1 ] = 0x01
282+ return doa .Err (m .con .Write (mph ))
266283 })
267284 case 0x01 :
268285 }
0 commit comments