Skip to content

Commit

Permalink
[XrdTpc] Properly forward existing opaque info to the OFS layer
Browse files Browse the repository at this point in the history
  • Loading branch information
esindril committed Jan 22, 2020
1 parent eb32442 commit c47b015
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/XrdCeph
2 changes: 1 addition & 1 deletion src/XrdClHttp
Submodule XrdClHttp updated 1 files
+3 −1 CMakeLists.txt
16 changes: 14 additions & 2 deletions src/XrdTpc/XrdTpcTPC.cc
Expand Up @@ -208,8 +208,20 @@ int TPCHandler::OpenWaitStall(XrdSfsFile &fh, const std::string &resource,
while (1) {
int orig_ucap = fh.error.getUCap();
fh.error.setUCap(orig_ucap | XrdOucEI::uIPv64);
open_result = fh.open(resource.c_str(), mode, openMode, &sec,
authz.empty() ? NULL: authz.c_str());
std::string opaque;
size_t pos = resource.find('?');
// Extract the path and opaque info from the resource
std::string path = resource.substr(0, pos);

if (pos != std::string::npos) {
opaque = resource.substr(pos + 1);
}

// Append the authz information
opaque += (opaque.empty() ? "" : "&");
opaque += authz;
open_result = fh.open(path.c_str(), mode, openMode, &sec, opaque.c_str());

if ((open_result == SFS_STALL) || (open_result == SFS_STARTED)) {
int secs_to_stall = fh.error.getErrInfo();
if (open_result == SFS_STARTED) {secs_to_stall = secs_to_stall/2 + 5;}
Expand Down

0 comments on commit c47b015

Please sign in to comment.