diff --git a/src/XrdTpc/XrdTpcMultistream.cc b/src/XrdTpc/XrdTpcMultistream.cc index 3b10f3b6971..ba659d2757b 100644 --- a/src/XrdTpc/XrdTpcMultistream.cc +++ b/src/XrdTpc/XrdTpcMultistream.cc @@ -263,7 +263,7 @@ class MultiCurlHandler { int TPCHandler::RunCurlWithStreamsImpl(XrdHttpExtReq &req, State &state, - size_t streams, std::vector handles, TPCLogRecord &rec) + size_t streams, std::vector &handles, TPCLogRecord &rec) { int result; bool success; @@ -358,8 +358,8 @@ int TPCHandler::RunCurlWithStreamsImpl(XrdHttpExtReq &req, State &state, msg = curl_multi_info_read(multi_handle, &msgq); if (msg && (msg->msg == CURLMSG_DONE)) { CURL *easy_handle = msg->easy_handle; - mch.FinishCurlXfer(easy_handle); res = msg->data.result; + mch.FinishCurlXfer(easy_handle); // If any requests fail, cut off the entire transfer. if (res != CURLE_OK) { break; diff --git a/src/XrdTpc/XrdTpcTPC.cc b/src/XrdTpc/XrdTpcTPC.cc index babaa8bfe56..2614abaeaff 100644 --- a/src/XrdTpc/XrdTpcTPC.cc +++ b/src/XrdTpc/XrdTpcTPC.cc @@ -610,14 +610,14 @@ int TPCHandler::ProcessPushReq(const std::string & resource, XrdHttpExtReq &req) if (name) rec.name = name; logTransferEvent(LogMask::Info, rec, "PUSH_START", "Starting a push request"); CURL *curl = curl_easy_init(); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); if (!curl) { char msg[] = "Failed to initialize internal transfer resources"; rec.status = 500; logTransferEvent(LogMask::Error, rec, "PUSH_FAIL", msg); return req.SendSimpleResp(rec.status, NULL, NULL, msg, 0); } - + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + auto query_header = req.headers.find("xrd-http-fullresource"); std::string redirect_resource = req.resource; if (query_header != req.headers.end()) { @@ -686,13 +686,13 @@ int TPCHandler::ProcessPullReq(const std::string &resource, XrdHttpExtReq &req) if (name) rec.name = name; logTransferEvent(LogMask::Info, rec, "PULL_START", "Starting a push request"); CURL *curl = curl_easy_init(); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); if (!curl) { char msg[] = "Failed to initialize internal transfer resources"; rec.status = 500; logTransferEvent(LogMask::Error, rec, "PULL_FAIL", msg); return req.SendSimpleResp(rec.status, NULL, NULL, msg, 0); } + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); std::unique_ptr fh(m_sfs->newFile(name, m_monid++)); if (!fh.get()) { curl_easy_cleanup(curl); diff --git a/src/XrdTpc/XrdTpcTPC.hh b/src/XrdTpc/XrdTpcTPC.hh index 3d2d72ded68..a0a724a429e 100644 --- a/src/XrdTpc/XrdTpcTPC.hh +++ b/src/XrdTpc/XrdTpcTPC.hh @@ -88,7 +88,7 @@ private: int RunCurlWithStreams(XrdHttpExtReq &req, TPC::State &state, size_t streams, TPCLogRecord &rec); int RunCurlWithStreamsImpl(XrdHttpExtReq &req, TPC::State &state, - size_t streams, std::vector streams_handles, + size_t streams, std::vector &streams_handles, TPCLogRecord &rec); #else int RunCurlBasic(CURL *curl, XrdHttpExtReq &req, TPC::State &state,