33 #include <sys/param.h>
47 const char *iName,
int Opts)
58 strcpy(buff, p); strcat(buff, (
Opts &
isServ ?
"olbd.notes":
"olbd.seton"));
59 destPath = strdup(buff); free(p);
77 if (destPath) free(destPath);
78 if (xMsg)
delete xMsg;
87 static const int Cln = 6;
88 const char *Cmd = (isPfn ?
"gone " :
"rmdid ");
89 char theMsg[MAXPATHLEN+8];
94 if ((n = strlen(
Path)) > MAXPATHLEN)
return -ENAMETOOLONG;
95 strcpy(theMsg, Cmd); strcpy(theMsg+Cln,
Path);
96 n += Cln; theMsg[n] =
'\n';
100 return Send(theMsg, n);
109 static const int Cln = 6;
110 const char *Cmd = (isPfn ?
"have " :
"newfn ");
111 char theMsg[MAXPATHLEN+8];
116 if ((n = strlen(
Path)) > MAXPATHLEN)
return -ENAMETOOLONG;
117 strcpy(theMsg, Cmd); strcpy(theMsg+Cln,
Path);
118 n += Cln; theMsg[n] =
'\n';
122 return Send(theMsg, n);
129 int XrdNetCmsNotify::Send(
const char *theMsg,
int theLen)
140 if ((rc = xMsg->
Send(theMsg, theLen)))
return rc < 0 ? rc : -ETIMEDOUT;
int Have(const char *Path, int isPfn=1)
XrdNetCmsNotify(XrdSysError *erp, const char *aPath, const char *iName, int Opts=0)
int Gone(const char *Path, int isPfn=1)
int Send(const char *buff, int blen=0, const char *dest=0, int tmo=-1)
static char * genPath(const char *path, const char *inst, const char *psfx=0)
static const char * InstName(int TranOpt=0)
static void Wait(int milliseconds)