Maintenance: Removed deprecated Client::replyBodySpace()#2060
Conversation
The deprecated method was basically a duplicate of Client::calcBufferSpaceToReserve().
| const int read_sz = replyBodySpace(*data.readBuf, 0); | ||
| // XXX: We only use this call to decide whether to read; we never increase data.readBuf space. | ||
| // TODO: Upgrade data.readBuf to SBuf and merge this with similar HttpStateData::readReply() code. | ||
| const auto read_sz = calcBufferSpaceToReserve(data.readBuf->spaceSize(), data.readBuf->spaceSize()); |
There was a problem hiding this comment.
- The second parameter in removed replyBodySpace() is called minSpace. We passed 0.
- The second parameter in calcBufferSpaceToReserve() is called wantSpace. We now pass spaceSize().
In both cases, the end result is exactly the same!
The value change makes sense because parameter names differ, and buffer spaceSize() is much closer to wantSpace than 0 would be -- we do not want to get rid of the existing buffer space. Neither value is actually "ideal" or "best", but improving requires difficult refactoring that lies outside this no-behavior-changes cleanup PR. We have several related TODOs/XXXs and runtime bugs. This small/simple PR helps with ongoing refactoring that will eventually address those. It is a small but useful step forward.
This comment does not request any PR changes.
|
There is also the change of |
Yes, I have adjusted PR description to document that difference as well. The different code is never executed for the removed call and for the added one (because the corresponding |
Except for a trivial spaceSize() call and a never-executed (for the only caller) `space` parameter adjustment, replyBodySpace() duplicates Client::calcBufferSpaceToReserve(). This duplication complicates refactoring aimed at addressing other known buffer management problems.
Except for a trivial spaceSize() call and a never-executed (for the only caller) `space` parameter adjustment, replyBodySpace() duplicates Client::calcBufferSpaceToReserve(). This duplication complicates refactoring aimed at addressing other known buffer management problems.
Except for a trivial spaceSize() call and a never-executed (for the only caller) `space` parameter adjustment, replyBodySpace() duplicates Client::calcBufferSpaceToReserve(). That duplication complicates refactoring aimed at addressing other known buffer management problems.
Except for a trivial spaceSize() call and a never-executed (for the only caller) `space` parameter adjustment, replyBodySpace() duplicates Client::calcBufferSpaceToReserve(). This duplication complicates refactoring aimed at addressing other known buffer management problems.
|
@eduard-bagdasaryan, our issues with github have now been resolved. You just need to rebase/merge the PR branch on latest master branch content (or click the "update branch" button on github UI that does it for you). |
|
Done, please remove the M-failed-staging-checks label to get it merged. |
Except for a trivial spaceSize() call and a never-executed (for the only caller) `space` parameter adjustment, replyBodySpace() duplicates Client::calcBufferSpaceToReserve(). This duplication complicates refactoring aimed at addressing other known buffer management problems.
Except for a trivial spaceSize() call and a never-executed (for the only
caller)
spaceparameter adjustment, replyBodySpace() duplicatesClient::calcBufferSpaceToReserve(). This duplication complicates
refactoring aimed at addressing other known buffer management problems.