57 const char *Lfn,
const char *Pfn,
58 const char *Cks,
short lfnLoc[2],
59 const char *Spr,
const char *Tpr)
60 :
XrdOfsTPC(Url, Org, Lfn, Pfn, Cks, Spr, Tpr),
61 Next(0), myProg(0), eCode(0), Status(isWaiting)
62 { lfnPos[0] = lfnLoc[0]; lfnPos[1] = lfnLoc[1]; }
77 {
if (
this == jobQ) jobQ = Next;
79 while(pP && pP->Next !=
this) pP = pP->Next;
80 if (pP) pP->Next = Next;
82 if (
this == jobLast) jobLast = pP;
83 inQ = 0; tpcCan =
true;
84 }
else if (Status == isRunning && myProg)
85 {myProg->
Cancel(); tpcCan =
true;}
97 if (
Refs <= 1) {jobMutex.
UnLock();
delete this;}
112 eCode = rc; Status = isDone;
114 Info.
Key = (rc ? strdup(eTxt) : 0);
126 {
if (jP == jobLast) jobQ = jobLast = 0;
127 else jobQ = jP->Next;
128 jP->myProg = pgmP; jP->
Refs++; jP->
inQ = 0; jP->Status = isRunning;
135 if (
Refs <= 1)
delete this;
146 static const int cbWaitTime = 1800;
152 if (Status == isRunning)
161 if (Status == isDone)
168 if (
inQ) {myProg = 0; rc = 0;}
179 Info.
Key = strdup(
"Copy failed; resources unavailable.");
180 return Info.
Fail(eRR,
"resources unavailable", ECANCELED);
186 if (jobLast) {jobLast->Next =
this; jobLast =
this;}
187 else jobQ = jobLast =
this;
int SetCB(XrdOucErrInfo *eRR)
void Reply(int rC, int eC, const char *eMsg, XrdSysMutex *mP=0)
int Fail(XrdOucErrInfo *eRR, const char *eMsg, int eCode)
XrdOfsTPCJob(const char *Url, const char *Org, const char *Lfn, const char *Pfn, const char *Cks, short lfnLoc[2], const char *Spr, const char *Tpr)
XrdOfsTPCJob * Done(XrdOfsTPCProg *pgmP, const char *eTxt, int rc)
int Sync(XrdOucErrInfo *eRR)
static XrdOfsTPCProg * Start(XrdOfsTPCJob *jP, int &rc)
int setErrInfo(int code, const char *emsg)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)