@@ -297,20 +297,21 @@ class print_file_upload_resource : public http_resource {
297297
298298// Raw multipart bytes preserve the missing name attribute; curl_mime would
299299// supply a name and conceal this malformed-input regression.
300- static std::pair<CURLcode, long > send_raw_multipart (int port, const string& body) {
300+ // libcurl requires long for POSTFIELDSIZE and the response-code output.
301+ static std::pair<CURLcode, long > send_raw_multipart (int port, const string& body) { // NOLINT(runtime/int)
301302 CURL * curl = curl_easy_init ();
302303 const string url = " http://127.0.0.1:" + std::to_string (port) + " /anything" ;
303304 curl_slist* headers = curl_slist_append (nullptr ,
304305 " Content-Type: multipart/form-data; boundary=BOUNDARY" );
305306 curl_easy_setopt (curl, CURLOPT_URL , url.c_str ());
306307 curl_easy_setopt (curl, CURLOPT_HTTPHEADER , headers);
307308 curl_easy_setopt (curl, CURLOPT_POSTFIELDS , body.data ());
308- curl_easy_setopt (curl, CURLOPT_POSTFIELDSIZE , static_cast <long >(body.size ()));
309+ curl_easy_setopt (curl, CURLOPT_POSTFIELDSIZE , static_cast <long >(body.size ())); // NOLINT(runtime/int)
309310 curl_easy_setopt (curl, CURLOPT_TIMEOUT , 5L );
310311 curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION ,
311312 +[](char *, size_t size, size_t count, void *) -> size_t { return size * count; });
312313 const CURLcode result = curl_easy_perform (curl);
313- long status = 0 ;
314+ long status = 0 ; // NOLINT(runtime/int)
314315 curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE , &status);
315316 curl_easy_cleanup (curl);
316317 curl_slist_free_all (headers);
0 commit comments