Skip to content

Commit

Permalink
Update Android/app/src/go/intra/split/retrier.go
Browse files Browse the repository at this point in the history
Co-authored-by: Vinicius Fortuna <fortuna@users.noreply.github.com>
  • Loading branch information
jyyi1 and fortuna authored Mar 18, 2024
1 parent da3f1f4 commit 08d9573
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Android/app/src/go/intra/split/retrier.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,17 @@ func splitHello(hello []byte, w io.Writer) (n int, splitLen int, err error) {
return
}

binary.BigEndian.PutUint16(hello[3:5], uint16(recordSplitLen))
if n, err = w.Write(hello[:splitLen]); err != nil {
pkt := hello[:splitLen]
binary.BigEndian.PutUint16(pkt[3:5], uint16(recordSplitLen))
if n, err = w.Write(pkt); err != nil {
return
}

copy(hello[splitLen-5:splitLen], hello[:5])
binary.BigEndian.PutUint16(hello[splitLen-2:splitLen], recordLen-uint16(recordSplitLen))
pkt = hello[splitLen-5:]
copy(pkt, hello[:5])
binary.BigEndian.PutUint16(pkt[3:5], recordLen-uint16(recordSplitLen))
var m int
m, err = w.Write(hello[splitLen-5:])
m, err = w.Write(pkt)
n += m
return
}
Expand Down

0 comments on commit 08d9573

Please sign in to comment.