-
Notifications
You must be signed in to change notification settings - Fork 373
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(rest): support rewinds in libcurl #11709
fix(rest): support rewinds in libcurl #11709
Conversation
This fixes problems I introduced in the first PR.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #11709 +/- ##
==========================================
+ Coverage 83.02% 83.03% +0.01%
==========================================
Files 1827 1830 +3
Lines 164734 164764 +30
==========================================
+ Hits 136765 136809 +44
+ Misses 27969 27955 -14
☔ View full report in Codecov by Sentry. |
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.
Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @coryan)
google/cloud/internal/curl_writev.h
line 57 at r1 (raw file):
} return avail - dst.size(); }
nit: Should these method implementations be moved to the new .cc file or is there an advantage to leaving them here in the .h?
Code quote:
explicit WriteVector(std::vector<absl::Span<char const>> v)
: original_(std::move(v)), writev_(original_.begin(), original_.end()) {}
std::size_t size() const {
std::size_t size = 0;
for (auto const& s : writev_) {
size += s.size();
}
return size;
}
std::size_t MoveTo(absl::Span<char> dst) {
auto const avail = dst.size();
while (!writev_.empty()) {
auto& src = writev_.front();
if (src.size() > dst.size()) {
std::copy(src.begin(), src.begin() + dst.size(), dst.begin());
src.remove_prefix(dst.size());
dst.remove_prefix(dst.size());
break;
}
std::copy(src.begin(), src.end(), dst.begin());
dst.remove_prefix(src.size());
writev_.pop_front();
}
return avail - dst.size();
}
google/cloud/internal/curl_writev.cc
Outdated
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN | ||
|
||
bool WriteVector::Seek(std::size_t offset, int origin) { | ||
// libcurl claims to only req |
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.
Incomplete comment?
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.
Fixed
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.
Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @devbww and @scotthart)
google/cloud/internal/curl_writev.h
line 57 at r1 (raw file):
Previously, scotthart (Scott Hart) wrote…
nit: Should these method implementations be moved to the new .cc file or is there an advantage to leaving them here in the .h?
Done.
This fixes problems I introduced in the first PR.
See #11703. Really fixes #11167
This change is