From 94c1198c827e82f46b18ab2796b9463ce3d28eed Mon Sep 17 00:00:00 2001 From: Michal Simon Date: Fri, 17 Jan 2020 11:29:51 +0100 Subject: [PATCH] [XrdCl] TPC: use separate cgi element to mark user intension to delegate. fixes #1118 --- src/XrdCl/XrdClThirdPartyCopyJob.cc | 8 +++----- src/XrdOuc/XrdOucTPC.cc | 8 ++++++++ src/XrdOuc/XrdOucTPC.hh | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/XrdCl/XrdClThirdPartyCopyJob.cc b/src/XrdCl/XrdClThirdPartyCopyJob.cc index f879c6c38a2..bcd620d99f2 100644 --- a/src/XrdCl/XrdClThirdPartyCopyJob.cc +++ b/src/XrdCl/XrdClThirdPartyCopyJob.cc @@ -438,10 +438,7 @@ namespace XrdCl //-------------------------------------------------------------------------- log->Debug( UtilityMsg, "Generating the destination TPC URL" ); - if( delegate ) - tpcKey = "delegate"; - else - tpcKey = GenerateKey(); + tpcKey = GenerateKey(); char *cgiBuff = new char[2048]; const char *cgiP = XrdOucTPC::cgiC2Dst( tpcKey.c_str(), @@ -450,7 +447,8 @@ namespace XrdCl 0, cgiBuff, 2048, nbStrm, GetSource().GetHostId().c_str(), GetSource().GetProtocol().c_str(), - GetTarget().GetProtocol().c_str() ); + GetTarget().GetProtocol().c_str(), + delegate ); if( *cgiP == '!' ) { diff --git a/src/XrdOuc/XrdOucTPC.cc b/src/XrdOuc/XrdOucTPC.cc index 4a8041b2ea5..b0db0941c6a 100644 --- a/src/XrdOuc/XrdOucTPC.cc +++ b/src/XrdOuc/XrdOucTPC.cc @@ -53,6 +53,7 @@ const char *XrdOucTPC::tpcSpr = "tpc.spr"; const char *XrdOucTPC::tpcStr = "tpc.str"; const char *XrdOucTPC::tpcTpr = "tpc.tpr"; const char *XrdOucTPC::tpcTtl = "tpc.ttl"; +const char *XrdOucTPC::tpcDlgOn = "tpc.dlgon"; /******************************************************************************/ /* c g i C 2 D s t */ @@ -63,6 +64,7 @@ const char *XrdOucTPC::cgiC2Dst(const char *cKey, const char *xSrc, char *Buff, int Blen, int strms, const char *iHst, const char *sprt, const char *tprt, + bool dlgon, bool push) { tpcInfo Info; @@ -115,6 +117,12 @@ const char *XrdOucTPC::cgiC2Dst(const char *cKey, const char *xSrc, if (Blen > 1) n = snprintf(bP, Blen, "&%s=1", tpcPsh); } + // tpc.dlgon + {bP += n; Blen -= n; + const char* cgistr = dlgon ? "&%s=1" : "&%s=0"; + if (Blen > 1) n = snprintf(bP, Blen, cgistr, tpcDlgOn); + } + // All done // diff --git a/src/XrdOuc/XrdOucTPC.hh b/src/XrdOuc/XrdOucTPC.hh index ee1251b0b29..9a439d71026 100644 --- a/src/XrdOuc/XrdOucTPC.hh +++ b/src/XrdOuc/XrdOucTPC.hh @@ -40,7 +40,7 @@ static const char *cgiC2Dst(const char *cKey, const char *xSrc, const char *xLfn, const char *xCks, char *Buff, int Blen, int strms=0, const char *iHst=0, const char *sprt=0, const char *tprt=0, - bool push=false); + bool dlgon=false, bool push=false); static const char *cgiC2Src(const char *cKey, const char *xDst, int xTTL, @@ -65,6 +65,7 @@ static const char *tpcSrc; static const char *tpcStr; static const char *tpcTpr; static const char *tpcTtl; +static const char *tpcDlgOn; XrdOucTPC() {} ~XrdOucTPC() {}