Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/root-ci-config/buildconfig/alma9.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
builtin_vdt=ON
davix=OFF
pythia8=ON
tmva-sofie=ON
2 changes: 1 addition & 1 deletion .github/workflows/root-ci-config/buildconfig/mac15.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
builtin_cfitsio=ON
builtin_cppzmq=ON
builtin_davix=ON
builtin_fftw3=ON
builtin_freetype=ON
builtin_ftgl=ON
Expand All @@ -20,6 +19,7 @@ builtin_xxhash=ON
builtin_zeromq=ON
builtin_zstd=ON
cocoa=ON
davix=OFF
minuit2_omp=OFF
r=OFF
tmva-sofie=ON
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CMAKE_CXX_STANDARD=23
davix=OFF
24 changes: 24 additions & 0 deletions net/curl/src/TCurlFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Bool_t TCurlFile::ReadBuffer(char *buf, Int_t len)
}

fOffset += range.fNBytesRecv;
fBytesRead += range.fNBytesRecv;
fReadCalls++;
#ifdef R__WIN32
SetFileBytesRead(GetFileBytesRead() + range.fNBytesRecv);
SetFileReadCalls(GetFileReadCalls() + 1);
#else
fgBytesRead += range.fNBytesRecv;
fgReadCalls++;
#endif
return kFALSE;
}

Expand All @@ -75,6 +84,15 @@ Bool_t TCurlFile::ReadBuffer(char *buf, Long64_t pos, Int_t len)
Error("TCurlFile", "can not read data: %s", status.fStatusMsg.c_str());
return kTRUE;
}
fBytesRead += range.fNBytesRecv;
fReadCalls++;
#ifdef R__WIN32
SetFileBytesRead(GetFileBytesRead() + range.fNBytesRecv);
SetFileReadCalls(GetFileReadCalls() + 1);
#else
fgBytesRead += range.fNBytesRecv;
fgReadCalls++;
#endif
return kFALSE;
}

Expand All @@ -93,6 +111,12 @@ Bool_t TCurlFile::ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
r.fLength = len[i];
ranges.emplace_back(r);
bufPos += len[i];
fBytesRead += r.fNBytesRecv;
#ifdef R__WIN32
SetFileBytesRead(GetFileBytesRead() + r.fNBytesRecv);
#else
fgBytesRead += r.fNBytesRecv;
#endif
}

auto status = fConnection->SendRangesReq(nbuf, &ranges[0]);
Expand Down
9 changes: 9 additions & 0 deletions net/curl/test/tfile_curl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "TCurlFile.h"

#include <cstdio>
#include <memory>
#include <utility>

Expand All @@ -17,3 +18,11 @@ TEST(TCurlFile, Read)
auto obj = f->Get("hpx");
EXPECT_TRUE(obj != nullptr);
}

TEST(TCurlFile, Cp)
{
const char *localPath = "root_test_curl_file_cp.root";
auto f = std::make_unique<TCurlFile>("https://root.cern.ch/files/tutorials/hsimple.root");
EXPECT_TRUE(f->Cp(localPath, false /* progressbar */));
remove(localPath);
}
Loading