jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
320 stars 74 forks source link

Fix up credit charge calculation #128

Closed jborean93 closed 3 years ago

jborean93 commented 3 years ago

Turns out the logic I had for calculating the credit charge was incorrect. The existing logic failed when attempting a read of 262145 bytes as the code was thinking it cost 4 credits instead of 5. This PR adjusts the credit calculation for this scenario.

Fixes https://github.com/jborean93/smbprotocol/issues/112

codecov[bot] commented 3 years ago

Codecov Report

Merging #128 (11e6673) into master (e2fb732) will decrease coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
- Coverage   98.90%   98.90%   -0.01%     
==========================================
  Files          23       23              
  Lines        4951     4950       -1     
==========================================
- Hits         4897     4896       -1     
  Misses         54       54              
Impacted Files Coverage Δ
smbclient/_io.py 99.02% <100.00%> (+<0.01%) :arrow_up:
smbprotocol/connection.py 99.83% <100.00%> (-0.01%) :arrow_down:

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 e2fb732...11e6673. Read the comment docs.