Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send big file failed when using HTTPS protocol #596

Open
guanweihao opened this issue Sep 1, 2022 · 0 comments
Open

Send big file failed when using HTTPS protocol #596

guanweihao opened this issue Sep 1, 2022 · 0 comments

Comments

@guanweihao
Copy link

guanweihao commented Sep 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant