#include <XrdOucStream.hh>
Public Member Functions | |
XrdOucStream (XrdSysError *erobj=0, const char *ifname=0, XrdOucEnv *anEnv=0, const char *Pfx=0) | |
~XrdOucStream () | |
int | Attach (int FileDescriptor, int bsz=2047) |
int | AttachIO (int infd, int outfd, int bsz=2047) |
void | Close (int hold=0) |
int | Detach () |
int | Drain () |
void | Echo () |
int | Exec (const char *, int inrd=0, int efd=0) |
int | Exec (char **, int inrd=0, int efd=0) |
int | FDNum () |
int | FENum () |
void | Flush () |
char * | GetLine () |
char * | GetToken (int lowcase=0) |
char * | GetToken (char **rest, int lowcase=0) |
void | RetToken () |
char * | GetFirstWord (int lowcase=0) |
char * | GetMyFirstWord (int lowcase=0) |
int | GetRest (char *theBuf, int Blen, int lowcase=0) |
char * | GetWord (int lowcase=0) |
int | isAlive () |
int | LastError () |
char * | LastLine () |
int | noEcho () |
int | Put (const char *data, const int dlen) |
int | Put (const char *data) |
int | Put (const char *data[], const int dlen[]) |
XrdOucEnv * | SetEnv (XrdOucEnv *newEnv) |
void | SetEroute (XrdSysError *eroute) |
void | Tabs (int x=1) |
int | Wait4Data (int msMax=-1) |
Private Member Functions | |
char * | add2llB (char *tok, int reset=0) |
char * | doelse () |
char * | doif () |
int | isSet (char *var) |
char * | vSubs (char *Var) |
int | xMsg (const char *txt1, const char *txt2=0, const char *txt3=0) |
Private Attributes | |
int | FD |
int | FE |
int | bsize |
int | bleft |
char * | buff |
char * | bnext |
char * | recp |
char * | token |
int | flags |
pid_t | child |
int | ecode |
int | notabs |
int | xcont |
int | xline |
char * | myInst |
char * | myHost |
char * | myName |
char * | myExec |
XrdSysError * | Eroute |
XrdOucEnv * | myEnv |
char * | varVal |
const char * | llPrefix |
char * | llBuff |
char * | llBcur |
int | llBleft |
char | Verbose |
char | sawif |
char | skpel |
char | llBok |
Static Private Attributes | |
static const int | maxVLen = 512 |
static const int | llBsz = 1024 |
Definition at line 26 of file XrdOucStream.hh.
XrdOucStream::XrdOucStream | ( | XrdSysError * | erobj = 0 , |
|
const char * | ifname = 0 , |
|||
XrdOucEnv * | anEnv = 0 , |
|||
const char * | Pfx = 0 | |||
) |
XrdOucStream::~XrdOucStream | ( | ) | [inline] |
int XrdOucStream::Attach | ( | int | FileDescriptor, | |
int | bsz = 2047 | |||
) |
Definition at line 124 of file XrdOucStream.cc.
References bleft, bnext, bsize, buff, Close(), ecode, Erq, FD, FE, flags, llBcur, llBleft, llBok, llBsz, llBuff, malloc(), recp, sawif, skpel, token, xcont, and xline.
Referenced by XrdNetLink::Alloc(), XrdCnsSsi::ApplyLog(), AttachIO(), XrdCns::CnsEvents(), XrdCmsConfig::ConfigProc(), XrdFrmConfig::ConfigProc(), Exec(), XrdSecsssKT::getKeyTab(), XrdCmsFinderTRG::Hookup(), XrdFrmCID::Init(), XrdFrmProxy::Init2(), XrdCnsSsi::List(), XrdProofdManager::LoadScheduler(), XrdCmsAdmin::Login(), main(), XrdCmsAdmin::Notes(), XrdAccAuthFile::Open(), XrdProofdConfig::ParseFile(), XrdFrmXfrDaemon::Pong(), XrdOfsEvr::recvEvents(), XrdFrmXfrAgent::Start(), and XrdCnsSsi::Updt().
int XrdOucStream::AttachIO | ( | int | infd, | |
int | outfd, | |||
int | bsz = 2047 | |||
) |
void XrdOucStream::Close | ( | int | hold = 0 |
) |
Definition at line 160 of file XrdOucStream.cc.
References buff, child, close, Drain(), Eroute, FD, FE, free(), llBok, llBuff, llPrefix, XrdSysError::Say(), and Verbose.
Referenced by XrdCmsFinderTRG::Added(), Attach(), XrdAccAuthFile::Close(), XrdCmsConfig::ConfigProc(), XrdFrmConfig::ConfigProc(), XrdSecsssKT::getKeyTab(), XrdFrmCID::Init(), XrdFrmProxy::Init2(), XrdCmsFinderTRG::Removed(), XrdOucProg::Restart(), XrdCmsFinderTRG::Start(), XrdCnsSsi::Updt(), XrdOfsEvr::~XrdOfsEvr(), and ~XrdOucStream().
int XrdOucStream::Detach | ( | ) | [inline] |
int XrdOucStream::Drain | ( | ) |
Definition at line 194 of file XrdOucStream.cc.
Referenced by Close(), XrdCmsMeter::Report(), XrdCmsPrepare::Reset(), and XrdOucProg::Run().
void XrdOucStream::Echo | ( | ) |
Definition at line 220 of file XrdOucStream.cc.
References Eroute, llBok, llBuff, llPrefix, XrdSysError::Say(), and Verbose.
Referenced by XrdCmsConfig::ConfigProc(), XrdFrmConfig::ConfigProc(), XrdFrmConfig::ConfigXeq(), XrdCmsConfig::ConfigXeq(), and XrdFrmProxy::Init2().
int XrdOucStream::Exec | ( | const char * | , | |
int | inrd = 0 , |
|||
int | efd = 0 | |||
) |
Definition at line 230 of file XrdOucStream.cc.
References free(), j, malloc(), MaxARGC, and strcpy().
Referenced by Exec(), XrdOucProg::Run(), XrdCmsMeter::Run(), and XrdCmsPrepare::startIF().
int XrdOucStream::Exec | ( | char ** | , | |
int | inrd = 0 , |
|||
int | efd = 0 | |||
) |
Definition at line 258 of file XrdOucStream.cc.
References Attach(), child, close, Eroute, Err, Erx, Exec(), F_SETFD, fcntl(), FD, FD_CLOEXEC, FE, fork(), XrdSysError::logger(), XrdSysLogger::originalFD(), pipe, setpgid, STDERR_FILENO, STDIN_FILENO, and STDOUT_FILENO.
int XrdOucStream::FDNum | ( | ) | [inline] |
Definition at line 85 of file XrdOucStream.hh.
References FD.
Referenced by XrdCmsAdmin::do_Login(), and XrdCmsFinderTRG::Start().
int XrdOucStream::FENum | ( | ) | [inline] |
void XrdOucStream::Flush | ( | ) | [inline] |
char * XrdOucStream::GetLine | ( | ) |
Definition at line 346 of file XrdOucStream.cc.
References bleft, bnext, bsize, buff, EMSGSIZE, Erp, FD, flags, notabs, NULL, read, recp, size_t, token, and XrdOucStream_EOM.
Referenced by XrdCnsSsi::ApplyLog(), XrdCnsDaemon::getEvents(), XrdSecsssKT::getKeyTab(), XrdNetLink::GetLine(), GetWord(), XrdFrmCID::Init(), XrdCnsSsi::List(), XrdCmsAdmin::Login(), XrdXrootdAdmin::Login(), main(), XrdOssSys::MSS_Readdir(), XrdOssSys::MSS_Xeq(), XrdCmsAdmin::Notes(), XrdFrmXfrDaemon::Pong(), XrdOfsEvr::recvEvents(), XrdCmsPrepare::Reset(), XrdOucProg::Run(), XrdCmsMeter::Run(), XrdFrmXfrAgent::Start(), XrdCnsSsi::Updt(), and XrdXrootdAdmin::Xeq().
char * XrdOucStream::GetToken | ( | int | lowcase = 0 |
) |
Definition at line 424 of file XrdOucStream.cc.
Referenced by XrdFrmXfrAgent::Add(), XrdFrmXfrAgent::Del(), XrdXrootdAdmin::do_Cj(), XrdXrootdAdmin::do_Disc(), XrdXrootdAdmin::do_Login(), XrdCmsAdmin::do_Login(), XrdXrootdAdmin::do_Lsj(), XrdXrootdAdmin::do_Pause(), XrdXrootdAdmin::do_Red(), XrdCmsAdmin::do_RmDid(), XrdCmsAdmin::do_RmDud(), XrdOfsEvr::eventStage(), XrdCnsDaemon::getEvents(), XrdSecsssKT::getKeyTab(), XrdCnsDaemon::getLFN(), XrdXrootdAdmin::getreqID(), XrdXrootdAdmin::getTarget(), GetToken(), XrdNetLink::GetToken(), GetWord(), XrdFrmCID::Init(), isSet(), XrdSecsssKT::ktDecode0(), XrdFrmXfrAgent::List(), XrdCmsAdmin::Login(), XrdXrootdAdmin::Login(), main(), XrdCmsAdmin::Notes(), XrdFrmXfrDaemon::Pong(), XrdFrmXfrAgent::Process(), XrdOfsEvr::recvEvents(), and XrdXrootdAdmin::Xeq().
char * XrdOucStream::GetToken | ( | char ** | rest, | |
int | lowcase = 0 | |||
) |
void XrdOucStream::RetToken | ( | ) |
Definition at line 603 of file XrdOucStream.cc.
References bnext, llBcur, llBleft, llBuff, recp, and token.
Referenced by XrdProofdNetMgr::DoDirectiveBonjour(), XrdROOTMgr::DoDirectiveRootSys(), XrdProofdNetMgr::DoDirectiveWorker(), XrdNetLink::RetToken(), XrdCmsConfig::xfsxq(), and XrdCmsConfig::xprepm().
char * XrdOucStream::GetFirstWord | ( | int | lowcase = 0 |
) |
Definition at line 472 of file XrdOucStream.cc.
References GetWord(), SetEnv(), and xline.
Referenced by doelse(), doif(), and GetMyFirstWord().
char * XrdOucStream::GetMyFirstWord | ( | int | lowcase = 0 |
) |
Definition at line 489 of file XrdOucStream.cc.
References add2llB(), doelse(), doif(), ecode, XrdSysError::Emsg(), Eroute, GetFirstWord(), isSet(), llBok, llBuff, llPrefix, myEnv, myInst, sawif, XrdSysError::Say(), skpel, and Verbose.
Referenced by XrdCmsConfig::ConfigProc(), XrdFrmConfig::ConfigProc(), XrdFrmProxy::Init2(), XrdProofdManager::LoadScheduler(), and XrdProofdConfig::ParseFile().
int XrdOucStream::GetRest | ( | char * | theBuf, | |
int | Blen, | |||
int | lowcase = 0 | |||
) |
Definition at line 577 of file XrdOucStream.cc.
References add2llB(), GetWord(), and strcpy().
Referenced by XrdProofdNetMgr::DoDirectiveWorker(), XrdFrmConfig::Grab(), XrdCmsConfig::xnml(), XrdFrmConfig::xnml(), XrdCmsConfig::xolib(), XrdCmsConfig::xperf(), XrdFrmConfig::xpolprog(), XrdCmsConfig::xprep(), XrdCmsConfig::xprepm(), and XrdCmsConfig::xxmi().
char * XrdOucStream::GetWord | ( | int | lowcase = 0 |
) |
Definition at line 533 of file XrdOucStream.cc.
References add2llB(), bnext, buff, GetLine(), GetToken(), myEnv, vSubs(), xcont, and xline.
Referenced by XrdProofdProtCfg::DoDirective(), XrdProofdNetMgr::DoDirectiveBonjour(), XrdProofdClientMgr::DoDirectiveClientMgr(), XrdProofdAdmin::DoDirectiveCpCmd(), XrdProofdManager::DoDirectiveDataDir(), XrdProofdManager::DoDirectiveDataSetSrc(), XrdProofdAdmin::DoDirectiveExportPath(), XrdProofdPriorityMgr::DoDirectivePriority(), XrdProofdProofServMgr::DoDirectiveProofServMgr(), XrdProofSched::DoDirectiveResource(), XrdProofdNetMgr::DoDirectiveResource(), XrdROOTMgr::DoDirectiveRootSys(), XrdProofSched::DoDirectiveSchedParam(), XrdProofdProofServMgr::DoDirectiveShutdown(), XrdProofdManager::DoDirectiveTrace(), XrdProofdNetMgr::DoDirectiveWorker(), doelse(), XrdProofdProofServMgr::ExtractEnv(), GetFirstWord(), XrdAccAuthFile::getPP(), XrdAccAuthFile::getRec(), GetRest(), XrdFrmConfig::Grab(), XrdProofdManager::LoadScheduler(), XrdProofdConfig::ParseFile(), XrdFrmProxy::qChk(), XrdCmsConfig::xallow(), XrdCmsConfig::xapath(), XrdFrmConfig::xapath(), XrdFrmConfig::xcmax(), XrdFrmConfig::xcopy(), XrdCmsConfig::xdelay(), XrdFrmConfig::xdpol(), XrdCmsConfig::xfsxq(), XrdCmsConfig::xfxhld(), XrdFrmConfig::xitm(), XrdCmsConfig::xlclrt(), XrdCmsConfig::xmang(), XrdFrmConfig::xmon(), XrdCmsConfig::xnml(), XrdFrmConfig::xnml(), XrdCmsConfig::xolib(), XrdCmsConfig::xperf(), XrdCmsConfig::xpidf(), XrdCmsConfig::xping(), XrdFrmConfig::xpol(), XrdFrmConfig::xpolprog(), XrdCmsConfig::xprep(), XrdCmsConfig::xprepm(), XrdFrmConfig::xqchk(), XrdCmsConfig::xrmtrt(), XrdCmsConfig::xrole(), XrdCmsConfig::xsched(), XrdCmsConfig::xsecl(), XrdCmsConfig::xspace(), XrdFrmConfig::xspace(), XrdCmsConfig::xtrace(), XrdFrmConfig::xxfr(), and XrdCmsConfig::xxmi().
int XrdOucStream::isAlive | ( | ) | [inline] |
Definition at line 131 of file XrdOucStream.hh.
References child.
Referenced by XrdCmsPrepare::Add(), XrdCmsPrepare::Del(), XrdOucProg::Feed(), XrdCmsPrepare::Reset(), and XrdCmsPrepare::Scrub().
int XrdOucStream::LastError | ( | ) | [inline] |
Definition at line 138 of file XrdOucStream.hh.
Referenced by XrdCmsConfig::ConfigProc(), XrdFrmConfig::ConfigProc(), XrdOucProg::Feed(), XrdSecsssKT::getKeyTab(), XrdFrmCID::Init(), XrdFrmProxy::Init2(), XrdNetLink::LastError(), XrdOssSys::MSS_Readdir(), XrdCmsAdmin::Notes(), XrdAccAuthFile::Open(), XrdCmsPrepare::Reset(), XrdOucProg::Run(), and XrdCmsPrepare::startIF().
char* XrdOucStream::LastLine | ( | ) | [inline] |
int XrdOucStream::noEcho | ( | ) | [inline] |
Definition at line 146 of file XrdOucStream.hh.
References llBok.
Referenced by XrdFrmConfig::ConfigXeq(), XrdCmsConfig::xallow(), XrdCmsConfig::xdefs(), XrdCmsConfig::xdelay(), XrdCmsConfig::xfsxq(), XrdCmsConfig::xfxhld(), XrdCmsConfig::xlclrt(), XrdCmsConfig::xmang(), XrdCmsConfig::xperf(), XrdCmsConfig::xprep(), XrdCmsConfig::xrmtrt(), and XrdCmsConfig::xsecl().
int XrdOucStream::Put | ( | const char * | data, | |
const int | dlen | |||
) |
Definition at line 629 of file XrdOucStream.cc.
References ecode, Erp, ETXTBSY, FE, flags, size_t, write, and XrdOucStream_BUSY.
Referenced by XrdCmsPrepare::Add(), XrdCmsFinderTRG::Added(), XrdCmsPrepare::Del(), XrdXrootdAdmin::do_Cj(), XrdXrootdAdmin::do_Login(), XrdXrootdAdmin::do_Lsc(), XrdXrootdAdmin::do_Lsd(), XrdXrootdAdmin::do_Lsj(), XrdXrootdAdmin::do_Lsj_Xeq(), XrdOucProg::Feed(), Put(), XrdCmsFinderTRG::Removed(), XrdCmsPrepare::Reset(), XrdXrootdAdmin::sendErr(), XrdXrootdAdmin::sendOK(), and XrdCmsFinderTRG::Start().
int XrdOucStream::Put | ( | const char * | data | ) | [inline] |
int XrdOucStream::Put | ( | const char * | data[], | |
const int | dlen[] | |||
) |
Definition at line 162 of file XrdOucStream.hh.
References myEnv.
Referenced by GetFirstWord(), XrdFrmConfig::Grab(), and XrdCmsConfig::xprepm().
void XrdOucStream::SetEroute | ( | XrdSysError * | eroute | ) | [inline] |
Definition at line 167 of file XrdOucStream.hh.
References Eroute, and eroute().
Referenced by XrdCmsConfig::ConfigProc(), XrdXrootdAdmin::Login(), and XrdAccAuthFile::Open().
void XrdOucStream::Tabs | ( | int | x = 1 |
) | [inline] |
int XrdOucStream::Wait4Data | ( | int | msMax = -1 |
) |
Definition at line 673 of file XrdOucStream.cc.
References FD, poll(), POLLIN, POLLRDNORM, and pollfd::revents.
Referenced by XrdOssSys::MSS_Xeq().
char * XrdOucStream::add2llB | ( | char * | tok, | |
int | reset = 0 | |||
) | [private] |
char * XrdOucStream::doelse | ( | ) | [private] |
Definition at line 729 of file XrdOucStream.cc.
References doif(), ecode, XrdSysError::Emsg(), Eroute, GetFirstWord(), GetWord(), sawif, and skpel.
Referenced by GetMyFirstWord().
char * XrdOucStream::doif | ( | ) | [private] |
Definition at line 793 of file XrdOucStream.cc.
References XrdOucUtils::doIf(), ecode, Eroute, GetFirstWord(), myExec, myHost, myName, sawif, and skpel.
Referenced by doelse(), and GetMyFirstWord().
int XrdOucStream::isSet | ( | char * | var | ) | [private] |
Definition at line 834 of file XrdOucStream.cc.
References Eroute, XrdOucEnv::Export(), free(), XrdOucEnv::Get(), getenv(), GetToken(), llBcur, llBleft, llBok, llBsz, llBuff, malloc(), maxVLen, myEnv, XrdOucEnv::Put(), XrdSysError::Say(), strcat(), strcpy(), strlcpy(), Verbose, vp, and xMsg().
Referenced by GetMyFirstWord().
char * XrdOucStream::vSubs | ( | char * | Var | ) | [private] |
int XrdOucStream::xMsg | ( | const char * | txt1, | |
const char * | txt2 = 0 , |
|||
const char * | txt3 = 0 | |||
) | [private] |
const int XrdOucStream::maxVLen = 512 [static, private] |
const int XrdOucStream::llBsz = 1024 [static, private] |
Definition at line 192 of file XrdOucStream.hh.
Referenced by add2llB(), Attach(), isSet(), and XrdOucStream().
int XrdOucStream::FD [private] |
Definition at line 194 of file XrdOucStream.hh.
Referenced by Attach(), Close(), Detach(), Exec(), FDNum(), Flush(), GetLine(), Wait4Data(), and XrdOucStream().
int XrdOucStream::FE [private] |
Definition at line 195 of file XrdOucStream.hh.
Referenced by Attach(), AttachIO(), Close(), Detach(), Exec(), FENum(), Flush(), Put(), and XrdOucStream().
int XrdOucStream::bsize [private] |
Definition at line 196 of file XrdOucStream.hh.
Referenced by Attach(), GetLine(), and XrdOucStream().
int XrdOucStream::bleft [private] |
Definition at line 197 of file XrdOucStream.hh.
Referenced by Attach(), GetLine(), and XrdOucStream().
char* XrdOucStream::buff [private] |
Definition at line 198 of file XrdOucStream.hh.
Referenced by Attach(), Close(), GetLine(), GetWord(), and XrdOucStream().
char* XrdOucStream::bnext [private] |
Definition at line 199 of file XrdOucStream.hh.
Referenced by Attach(), GetLine(), GetWord(), RetToken(), and XrdOucStream().
char* XrdOucStream::recp [private] |
Definition at line 200 of file XrdOucStream.hh.
Referenced by Attach(), GetLine(), LastLine(), RetToken(), and XrdOucStream().
char* XrdOucStream::token [private] |
Definition at line 201 of file XrdOucStream.hh.
Referenced by Attach(), GetLine(), GetToken(), RetToken(), and XrdOucStream().
int XrdOucStream::flags [private] |
Definition at line 202 of file XrdOucStream.hh.
Referenced by Attach(), GetLine(), Put(), and XrdOucStream().
pid_t XrdOucStream::child [private] |
Definition at line 203 of file XrdOucStream.hh.
Referenced by Close(), Drain(), Exec(), isAlive(), and XrdOucStream().
int XrdOucStream::ecode [private] |
Definition at line 204 of file XrdOucStream.hh.
Referenced by Attach(), doelse(), doif(), GetMyFirstWord(), LastError(), Put(), xMsg(), and XrdOucStream().
int XrdOucStream::notabs [private] |
Definition at line 205 of file XrdOucStream.hh.
Referenced by GetLine(), Tabs(), and XrdOucStream().
int XrdOucStream::xcont [private] |
Definition at line 206 of file XrdOucStream.hh.
Referenced by Attach(), GetWord(), and XrdOucStream().
int XrdOucStream::xline [private] |
Definition at line 207 of file XrdOucStream.hh.
Referenced by Attach(), GetFirstWord(), GetWord(), and XrdOucStream().
char* XrdOucStream::myInst [private] |
Definition at line 208 of file XrdOucStream.hh.
Referenced by GetMyFirstWord(), XrdOucStream(), and ~XrdOucStream().
char* XrdOucStream::myHost [private] |
char* XrdOucStream::myName [private] |
char* XrdOucStream::myExec [private] |
XrdSysError* XrdOucStream::Eroute [private] |
Definition at line 212 of file XrdOucStream.hh.
Referenced by Close(), doelse(), doif(), Echo(), Exec(), GetMyFirstWord(), isSet(), SetEroute(), xMsg(), and XrdOucStream().
XrdOucEnv* XrdOucStream::myEnv [private] |
Definition at line 213 of file XrdOucStream.hh.
Referenced by GetMyFirstWord(), GetWord(), isSet(), SetEnv(), vSubs(), and XrdOucStream().
char* XrdOucStream::varVal [private] |
Definition at line 214 of file XrdOucStream.hh.
Referenced by vSubs(), XrdOucStream(), and ~XrdOucStream().
const char* XrdOucStream::llPrefix [private] |
Definition at line 215 of file XrdOucStream.hh.
Referenced by Close(), Echo(), GetMyFirstWord(), and XrdOucStream().
char* XrdOucStream::llBuff [private] |
Definition at line 216 of file XrdOucStream.hh.
Referenced by add2llB(), Attach(), Close(), Echo(), GetMyFirstWord(), isSet(), RetToken(), XrdOucStream(), and ~XrdOucStream().
char* XrdOucStream::llBcur [private] |
Definition at line 217 of file XrdOucStream.hh.
Referenced by add2llB(), Attach(), isSet(), RetToken(), and XrdOucStream().
int XrdOucStream::llBleft [private] |
Definition at line 218 of file XrdOucStream.hh.
Referenced by add2llB(), Attach(), isSet(), RetToken(), and XrdOucStream().
char XrdOucStream::Verbose [private] |
Definition at line 219 of file XrdOucStream.hh.
Referenced by Close(), Echo(), GetMyFirstWord(), isSet(), and XrdOucStream().
char XrdOucStream::sawif [private] |
Definition at line 220 of file XrdOucStream.hh.
Referenced by Attach(), doelse(), doif(), GetMyFirstWord(), and XrdOucStream().
char XrdOucStream::skpel [private] |
Definition at line 221 of file XrdOucStream.hh.
Referenced by Attach(), doelse(), doif(), GetMyFirstWord(), and XrdOucStream().
char XrdOucStream::llBok [private] |
Definition at line 222 of file XrdOucStream.hh.
Referenced by add2llB(), Attach(), Close(), Echo(), GetMyFirstWord(), isSet(), noEcho(), and XrdOucStream().