Skip to content

Commit 41fbaca

Browse files
committed
Potential fix for #450
1 parent 4618d13 commit 41fbaca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cpr/session.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ void Session::Impl::SetBody(Body&& body) {
312312
hasBodyOrPayload_ = true;
313313
auto curl = curl_->handle;
314314
if (curl) {
315-
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, body.str().length());
315+
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE,
316+
static_cast<curl_off_t>(body.str().length()));
316317
curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, body.c_str());
317318
}
318319
}
@@ -321,7 +322,8 @@ void Session::Impl::SetBody(const Body& body) {
321322
hasBodyOrPayload_ = true;
322323
auto curl = curl_->handle;
323324
if (curl) {
324-
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, body.str().length());
325+
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE,
326+
static_cast<curl_off_t>(body.str().length()));
325327
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
326328
}
327329
}

0 commit comments

Comments
 (0)