Skip to content

Commit bd53478

Browse files
committed
Ensure LowSpeed properties are cased to long for curl
1 parent c9e2c87 commit bd53478

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpr/session.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ void Session::SetBody(Body&& body) {
489489
}
490490

491491
void Session::SetLowSpeed(const LowSpeed& low_speed) {
492-
curl_easy_setopt(curl_->handle, CURLOPT_LOW_SPEED_LIMIT, low_speed.limit);
493-
curl_easy_setopt(curl_->handle, CURLOPT_LOW_SPEED_TIME, low_speed.time); // cppcheck-suppress y2038-unsafe-call
492+
curl_easy_setopt(curl_->handle, CURLOPT_LOW_SPEED_LIMIT, static_cast<long>(low_speed.limit));
493+
curl_easy_setopt(curl_->handle, CURLOPT_LOW_SPEED_TIME, static_cast<long>(low_speed.time.count())); // cppcheck-suppress y2038-unsafe-call
494494
}
495495

496496
void Session::SetVerifySsl(const VerifySsl& verify) {

0 commit comments

Comments
 (0)