Skip to content

Update progress during upload #1354

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

Merged
merged 1 commit into from
Feb 13, 2017
Merged

Conversation

odiszapc
Copy link
Contributor

To resolve #728

@slandelle
Copy link
Contributor

Thanks! Could you please update your commit message to match this template?

Motivation:

org.asynchttpclient.netty.request.body.BodyChunkedInput does not update
progress member, it stays zero whole time.
Thus
org.asynchttpclient.handler.onContentWriteProgress#onContentWriteProgress
receives zeroes in ammount and current parameters. Users sees data is
being sent but has no information about exact amount of data has been
written to channel.

Modifications:

org.asynchttpclient.netty.request.body.BodyChunkedInput was modified to
update progress.
org.asynchttpclient.netty.request.WriteProgressListener was modified to
ignore zero progress. It happens due to non-blocking nature of network
writes. We just ignore callbacks when there was no progress at all.

Result:

Progress is updated each time bytes are phisically written to channel.
Callbacks are triggered with actual amount of data written.
@odiszapc
Copy link
Contributor Author

Done. Please check

@slandelle slandelle merged commit 43cff3a into AsyncHttpClient:master Feb 13, 2017
@slandelle slandelle added this to the 2.1.0 milestone Feb 13, 2017
@slandelle
Copy link
Contributor

Awesome, thanks a lot!

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

Successfully merging this pull request may close these issues.

How can I get progress rate when uploading big file? Get it when uploading not completed!
2 participants