}
}
-size_t AWSv4ComplMulti::recv_body(char* const buf, const size_t buf_max)
+size_t AWSv4ComplMulti::recv_chunk(char* const buf, const size_t buf_max, bool& eof)
{
/* Buffer stores only parsed stream. Raw values reflect the stream
* we're getting from a client. */
to_extract);
parsing_buf.resize(parsing_buf.size() - (to_extract - received));
if (received == 0) {
+ eof = true;
break;
}
dout(30) << "AWSv4ComplMulti: to_extract=" << to_extract << ", received=" << received << dendl;
if (received == 0) {
+ eof = true;
break;
}
return buf_pos;
}
+size_t AWSv4ComplMulti::recv_body(char* const buf, const size_t buf_max)
+{
+ bool eof = false;
+ size_t total = 0;
+
+ while (total < buf_max && !eof) {
+ const size_t received = recv_chunk(buf + total, buf_max - total, eof);
+ total += received;
+ }
+ dout(20) << "AWSv4ComplMulti: received=" << total << dendl;
+ return total;
+}
+
void AWSv4ComplMulti::modify_request_state(const DoutPrefixProvider* dpp, req_state* const s_rw)
{
const char* const decoded_length = \
bool is_signature_mismatched();
std::string calc_chunk_signature(const std::string& payload_hash) const;
+ size_t recv_chunk(char* buf, size_t max, bool& eof);
public:
/* We need the constructor to be public because of the std::make_shared that