Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Oct 29, 2024
1 parent 23dc762 commit 32a9bed
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cpp/include/kvikio/shim/libcurl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,16 @@ class CurlHandle {
_source_line(std::move(source_line))
{
// Removing all '\0' characters
auto _source_file_size = _source_file.size();
_source_file.erase(std::remove(_source_file.begin(), _source_file.end(), '\0'),
_source_file.end());
if (_source_file_size != _source_file.size()) {
std::stringstream ss;
ss << "CurlHandle - `source_file` contains " << _source_file_size - _source_file.size()
<< " '\\0' chars?!? - source_file: " << _source_file;

throw std::runtime_error(ss.str());
}

// Need CURLOPT_NOSIGNAL to support threading, see
// <https://curl.se/libcurl/c/CURLOPT_NOSIGNAL.html>
Expand Down Expand Up @@ -260,7 +268,9 @@ class CurlHandle {
*
* @returns A `kvikio::CurlHandle` instance ready to be used.
*/
#define create_curl_handle() \
kvikio::CurlHandle(kvikio::LibCurl::instance().get_handle(), __FILE__, KVIKIO_STRINGIFY(__LINE__))
#define create_curl_handle() \
kvikio::CurlHandle(kvikio::LibCurl::instance().get_handle(), \
__FILE__ ":" KVIKIO_STRINGIFY(__LINE__), \
KVIKIO_STRINGIFY(__LINE__))

} // namespace kvikio

0 comments on commit 32a9bed

Please sign in to comment.