@@ -311,9 +311,10 @@ XrdCmsTfc::TrivialFileCatalog::lfn2pfn(const char *lfn, char *buff, int blen)
311
311
protocol != m_protocols.end ();
312
312
protocol++)
313
313
{
314
- tmpLfn = applyRules (m_directRules, *protocol, m_destination, false , tmpLfn);
314
+ tmpLfn = applyRules (m_directRules, *protocol, m_destination, true , tmpLfn);
315
315
if (!tmpLfn.empty ()) {
316
316
strncpy (buff, tmpLfn.c_str (), blen);
317
+ eDest->Say (" Resulting PFN: " , buff);
317
318
return 0 ;
318
319
}
319
320
}
@@ -353,7 +354,7 @@ std::string replaceWithRegexp (const int ovector[OVECCOUNT], const int rc,
353
354
const std::string inputString,
354
355
const std::string outputFormat)
355
356
{
356
- std::cerr << " InputString:" << inputString << std::endl;
357
+ // std::cerr << "InputString:" << inputString << std::endl;
357
358
358
359
char buffer[8 ];
359
360
std::string result = outputFormat;
@@ -381,7 +382,7 @@ std::string replaceWithRegexp (const int ovector[OVECCOUNT], const int rc,
381
382
pcre_free (substitutionToken);
382
383
return " " ;
383
384
}
384
- std::cerr << " Current match: " << matchResult << std::endl;
385
+ // std::cerr << "Current match: " << matchResult << std::endl;
385
386
386
387
result = replace (result, substitutionToken, matchResult);
387
388
@@ -398,7 +399,7 @@ XrdCmsTfc::TrivialFileCatalog::applyRules (const ProtocolRules& protocolRules,
398
399
bool direct,
399
400
std::string name) const
400
401
{
401
- std::cerr << " Calling apply rules with protocol: " << protocol << " \n destination: " << destination << " \n " << " on name " << name << std::endl;
402
+ // std::cerr << "Calling apply rules with protocol: " << protocol << "\n destination: " << destination << "\n " << " on name " << name << std::endl;
402
403
403
404
const ProtocolRules::const_iterator rulesIterator = protocolRules.find (protocol);
404
405
if (rulesIterator == protocolRules.end ())
@@ -417,25 +418,25 @@ XrdCmsTfc::TrivialFileCatalog::applyRules (const ProtocolRules& protocolRules,
417
418
if (rc < 0 ) {
418
419
continue ;
419
420
} else {
420
- std::cerr << " Destination did match; my destination " << destination << " , regexp: " << i->destinationMatchStr << std::endl;
421
+ // std::cerr << "Destination did match; my destination " << destination << ", regexp: " << i->destinationMatchStr << std::endl;
421
422
}
422
423
423
424
rc = pcre_exec (i->pathMatch , NULL , name.c_str (), name.length (), 0 , 0 , ovector, OVECCOUNT);
424
425
if (rc < 0 ) {
425
426
continue ;
426
427
} else {
427
- std::cerr << " Path did match; my path " << name << " , regexp: " << i->pathMatchStr << std::endl;
428
+ // std::cerr << "Path did match; my path " << name << ", regexp: " << i->pathMatchStr << std::endl;
428
429
}
429
430
430
- std::cerr << " Rule matched; path: " << i->pathMatchStr << std::endl;
431
+ // std::cerr << "Rule matched; path: " << i->pathMatchStr << std::endl;
431
432
432
433
std::string chain = i->chain ;
433
434
if ((direct==true ) && (chain != " " ))
434
435
{
435
436
name =
436
437
applyRules (protocolRules, chain, destination, direct, name);
437
438
} else {
438
- std::cerr << " Not chaining another rule. " << std::endl;
439
+ // std::cerr << "Not chaining another rule! " << std::endl;
439
440
}
440
441
441
442
rc = pcre_exec (i->pathMatch , NULL , name.c_str (), name.length (), 0 , 0 , ovector,
@@ -444,15 +445,15 @@ XrdCmsTfc::TrivialFileCatalog::applyRules (const ProtocolRules& protocolRules,
444
445
if (rc >= 0 ) {
445
446
name = replaceWithRegexp (ovector, rc, name, i->result );
446
447
} else {
447
- std::cerr << " No replacements necessary." << std::endl;
448
+ // std::cerr << "No replacements necessary." << std::endl;
448
449
}
449
450
450
451
if ((direct == false ) && (chain !=" " ))
451
452
{
452
453
name =
453
454
applyRules (protocolRules, chain, destination, direct, name);
454
455
}
455
- std::cerr << " Result " << name << std::endl;
456
+ // std::cerr << "Result " << name << std::endl;
456
457
return name;
457
458
}
458
459
return " " ;
0 commit comments