-
Notifications
You must be signed in to change notification settings - Fork 57
Conversation
case "start": | ||
state = "send-transport"; | ||
runFSM(); | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Use semicolon after break
. Check the other instances of this too.
It'll take me a bit of time to look over the core algorithm... there's a lot going on there! Hoping to check it out later today. |
OK, wait for your feedback. Thanks for your patience. |
The pull request has been updated, add some semicolons and some comments. |
remaining = fileSize; | ||
fileData = new Uint8Array(new ArrayBuffer(fileSize)); | ||
currentPos = 0; | ||
remainingPkgData = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this more like receivedData
not "remaining" data? It's all the chunks we've received so far, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. When received a socket package, it maybe contain many chunks, often partial chunk at the end.
So, just handle full chunks and keep partial chunk in remainingPkgData, then combine it with next socket data.
@jryans The pull request has been updated, improved core algorithm, do you have time take a look? Thanks a lot. |
Great! It appears to work well. Thanks for working on this! |
Thanks for your high efficent review :) |
@jryans
Do you have time take a look?
The patch is finished yesterday and I have tested it this morning, pulling some normal files(pictures, videos, musics) from mobile to desktop, it seems work very well.