Send big file failed when using HTTPS protocol
- Dominant language
- C#
- Stars
- 4.3k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
1: Background
We transfer files between PC and Android Phone, Phone use netty and PC use our Dotnetty; Using HttpChunkedInput class, we use ReadChunk API to read a big File(for example, size = 1.3G) per 400Kb in PC, then send to Phone through HTTPS protocol;
2. what happened
Phone can received the first 400Kb piece, but will report error when start receive the second 400Kb piece.
3. analysis
Analysis the packet data in https protocol using Wireshark tool, we found the problem as below:
- TlsHandler Class wrap the 400K data and split to 28 pieces, the piece's maxlength is 16Kb
- the 28 pieces will be added to entryList in ChannelOutboundBuffer class
- when user invoke flush api, TcpSocketChannel class will write the entryList data to socket
The point is the last 3 pieces in first 400Kb is sent twice, so, when Phone start receive the second 400Kb, it expected received the first piece is http protocol head info, but it really received piece is the file data in first 400Kb(the first peice in last 3 pieces), so Phone report error and interrupt the https connection
Contributor guide
Assessment
This issue has not been assessed yet.