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

Fix #667: Don't buffer output stream when no progress callback is given #668

Merged
merged 2 commits into from
Aug 7, 2019

Conversation

jsyeo
Copy link

@jsyeo jsyeo commented Aug 7, 2019

Description

This fixes the slowness described in #667 by checking if a progress callback is set. If no progress callbacks are given, the outputstream will not be buffered.

Type of change

Check all that apply

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (a change which changes the current internal or external interface)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation, if necessary
  • My changes generate no new compiler warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Inspect the bytecode viewer, including reasoning why

@jsyeo jsyeo changed the title Fix #667. 🙅 📲 Don't buffer output stream when no progress callback is given Fix #667: Don't buffer output stream when no progress callback is given Aug 7, 2019
@codecov
Copy link

codecov bot commented Aug 7, 2019

Codecov Report

Merging #668 into master will decrease coverage by 0.05%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #668      +/-   ##
============================================
- Coverage     71.44%   71.39%   -0.06%     
  Complexity      296      296              
============================================
  Files            58       58              
  Lines          1492     1496       +4     
  Branches        192      193       +1     
============================================
+ Hits           1066     1068       +2     
  Misses          334      334              
- Partials         92       94       +2
Impacted Files Coverage Δ Complexity Δ
.../kotlin/com/github/kittinunf/fuel/core/Progress.kt 50% <100%> (+5.55%) 4 <1> (+1) ⬆️
...in/com/github/kittinunf/fuel/toolbox/HttpClient.kt 75.67% <80%> (-1.18%) 28 <0> (-1)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24c5ce1...777cfb4. Read the comment docs.

Ensures progress handlers would not be set when no callbacks are given
to the request.
@SleeplessByte SleeplessByte added the 🐛 bug Something isn't working label Aug 7, 2019
@SleeplessByte SleeplessByte merged commit 781be0f into kittinunf:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants