| 184 | } |
| 185 | |
| 186 | void HTTPClient::setUploadCallback(HTTPUploadCallback *callbackObj) { |
| 187 | logger_->log_debug("Setting callback for %s", url_); |
| 188 | write_callback_ = callbackObj; |
| 189 | if (method_ == "put" || method_ == "PUT") { |
| 190 | curl_easy_setopt(http_session_, CURLOPT_INFILESIZE_LARGE, (curl_off_t) callbackObj->ptr->getBufferSize()); |
| 191 | } |
| 192 | curl_easy_setopt(http_session_, CURLOPT_READFUNCTION, &utils::HTTPRequestResponse::send_write); |
| 193 | curl_easy_setopt(http_session_, CURLOPT_READDATA, static_cast<void*>(callbackObj)); |
| 194 | } |
| 195 | |
| 196 | void HTTPClient::setSeekFunction(HTTPUploadCallback *callbackObj) { |
| 197 | curl_easy_setopt(http_session_, CURLOPT_SEEKDATA, static_cast<void*>(callbackObj)); |
no test coverage detected