diff --git a/src/XProtocol/YProtocol.hh b/src/XProtocol/YProtocol.hh index f5e77a6b6bb..d9681065473 100644 --- a/src/XProtocol/YProtocol.hh +++ b/src/XProtocol/YProtocol.hh @@ -223,7 +223,7 @@ enum {kYR_refresh = 0x01, }; // kXR_string Path; -static const int RILen = 32; // Max length of each response item +static const int RHLen =266; // Max length of each host response item }; /******************************************************************************/ diff --git a/src/XrdCms/XrdCmsClientMan.cc b/src/XrdCms/XrdCmsClientMan.cc index 2ba28e3f699..3a63d55ff14 100644 --- a/src/XrdCms/XrdCmsClientMan.cc +++ b/src/XrdCms/XrdCmsClientMan.cc @@ -49,7 +49,7 @@ using namespace XrdCms; /* G l o b a l s */ /******************************************************************************/ -XrdOucBuffPool XrdCmsClientMan::BuffPool(XrdOucEI::Max_Error_Len, 65536, 64); +XrdOucBuffPool XrdCmsClientMan::BuffPool(XrdOucEI::Max_Error_Len, 65536, 1, 16); XrdInet *XrdCmsClientMan::Network = 0; diff --git a/src/XrdCms/XrdCmsCluster.cc b/src/XrdCms/XrdCmsCluster.cc index 3631d48b14d..88262c728f4 100644 --- a/src/XrdCms/XrdCmsCluster.cc +++ b/src/XrdCms/XrdCmsCluster.cc @@ -432,6 +432,7 @@ XrdCmsSelected *XrdCmsCluster::List(SMask_t mask, CmsLSOpts opts, int &nsel) { int i, lsall = opts & LS_All, retIP = opts & LS_IPO; int retIP4 = opts & LS_IP4, onlyIP4 = (opts & LS_IP4) && !(opts & LS_IP6); + int retID = opts & LS_IDNT; XrdCmsNode *nP; XrdCmsSelected *sipp = 0, *sip; @@ -443,14 +444,19 @@ XrdCmsSelected *XrdCmsCluster::List(SMask_t mask, CmsLSOpts opts, int &nsel) if ((nP=NodeTab[i]) && (lsall || (nP->NodeMask & mask))) {nsel++; if (onlyIP4 && !(nP->IPV4Len)) continue; - sip = new XrdCmsSelected(retIP ? 0 : nP->Name(), sipp); + sip = new XrdCmsSelected(sipp); if (retIP) {if (retIP4 && nP->IPV4Len) - {sip->IPV6Len = nP->IPV4Len; strcpy(sip->IPV6, nP->IPV4); + {sip->IdentLen = nP->IPV4Len; strcpy(sip->Ident, nP->IPV4); } else { - sip->IPV6Len = nP->IPV6Len; strcpy(sip->IPV6, nP->IPV6); + sip->IdentLen = nP->IPV6Len; strcpy(sip->Ident, nP->IPV6); } - } + } else if (retID) + {strcpy(sip->Ident, nP->locName); + sip->IdentLen = nP->locNLen; + } else {strcpy(sip->Ident, nP->myName); + sip->IdentLen = nP->myNlen; + } sip->Mask = nP->NodeMask; sip->Id = nP->NodeID; sip->Port = nP->Port; @@ -1115,7 +1121,7 @@ int XrdCmsCluster::Statt(char *bfr, int bln) *stp = 0; if (AddShr) snprintf(shrBuff, sizeof(shrBuff), statfmt3, (sp->Share ? sp->Share : 100), sp->Shrin); - mlen = snprintf(bfr, bln, statfmt2, n, sp->Name, + mlen = snprintf(bfr, bln, statfmt2, n, sp->Ident, XrdCmsRole::Type(static_cast(sp->RoleID)), stat, sp->RefTotR, sp->RefTotW, shrBuff); bfr += mlen; bln -= mlen; tlen += mlen; diff --git a/src/XrdCms/XrdCmsCluster.hh b/src/XrdCms/XrdCmsCluster.hh index c3567e56d26..c926a273ac1 100644 --- a/src/XrdCms/XrdCmsCluster.hh +++ b/src/XrdCms/XrdCmsCluster.hh @@ -137,7 +137,8 @@ SMask_t getMask(const char *Cid); // Extracts out node information. Opts are one or more of CmsLSOpts // -enum CmsLSOpts {LS_NULL=0, LS_IP4=1, LS_IP6=2, LS_IPO=3, LS_All=8}; +enum CmsLSOpts {LS_NULL=0, LS_IP4=1, LS_IP6=2, LS_IPO=3, + LS_IDNT=4, LS_All=8}; XrdCmsSelected *List(SMask_t mask, CmsLSOpts opts, int &nsel); diff --git a/src/XrdCms/XrdCmsNode.cc b/src/XrdCms/XrdCmsNode.cc index 434dcfa40cd..e52b192d144 100644 --- a/src/XrdCms/XrdCmsNode.cc +++ b/src/XrdCms/XrdCmsNode.cc @@ -137,6 +137,7 @@ XrdCmsNode::XrdCmsNode(XrdLink *lnkp, int port, TZValid = 0; TimeZone = 0; IPV6Len = 0; *IPV6 = 0; IPV4Len = 0; *IPV4 = 0; + locName = 0; // setName() will set Ident, netID, IPV6, myName, myNlen, & Port! // @@ -161,6 +162,7 @@ XrdCmsNode::~XrdCmsNode() if (Ident) free(Ident); if (myNID) free(myNID); if (myName)free(myName); + if (locName)free(locName); } /******************************************************************************/ @@ -196,13 +198,17 @@ void XrdCmsNode::setName(XrdLink *lnkp, int port) if (Ident) free(Ident); Ident = strdup(buff); - if (!Port) fmtOpts |= XrdNetAddr::noPort; - else oldPort = netID.Port(Port); +// Format locate target name +// + locNLen = sprintf(buff, "%s:%d", myName, (Port ? Port : 1094)); + if (locName) free(locName); + locName = strdup(buff); // Format out the address in IPv6 format // + oldPort = netID.Port((Port ? Port : 1094)); netID.Format(buff, sizeof(buff), XrdNetAddr::fmtAdv6, fmtOpts); - if (oldPort) netID.Port(oldPort); + netID.Port(oldPort); strlcpy(IPV6, buff, sizeof(IPV6)); IPV6Len = strlen(IPV6); @@ -514,7 +520,7 @@ const char *XrdCmsNode::do_Locate(XrdCmsRRData &Arg) XrdCmsSelect Sel(0, Arg.Path, Arg.PathLen-1); XrdCmsSelected *sP = 0; struct {kXR_unt32 Val; - char outbuff[CmsLocateRequest::RILen*STMax];} Resp; + char outbuff[CmsLocateRequest::RHLen*STMax];} Resp; struct iovec ioV[2] = {{(char *)&Arg.Request, sizeof(Arg.Request)}, {(char *)&Resp, 0}}; const char *Why; @@ -530,12 +536,27 @@ const char *XrdCmsNode::do_Locate(XrdCmsRRData &Arg) if (Xmi_Select->Select(&Req, XMI_LOCATE, Arg.Path, Arg.Opaque)) return 0; } +// Get the right options +// + if (Arg.Opts & CmsLocateRequest::kYR_retname) + lsopts = XrdCmsCluster::LS_IDNT; + else if (Arg.Opts & CmsLocateRequest::kYR_retipv6) + {lsopts |= XrdCmsCluster::LS_IP6; + if (Arg.Opts & CmsLocateRequest::kYR_retipv4) + lsopts |= XrdCmsCluster::LS_IP4; + } + else if (Arg.Opts & CmsLocateRequest::kYR_retipv4) + lsopts |= XrdCmsCluster::LS_IP4; + else lsopts = XrdCmsCluster::LS_IPO; + // Grab the refresh option (the only one we support) // if (Arg.Opts & CmsLocateRequest::kYR_refresh) {Sel.Opts = XrdCmsSelect::Refresh; *toP++='s';} if (Arg.Opts & CmsLocateRequest::kYR_asap) - {Sel.Opts |= XrdCmsSelect::Asap; *toP++='i'; Sel.InfoP = &reqInfo;} + {Sel.Opts |= XrdCmsSelect::Asap; *toP++='i'; Sel.InfoP = &reqInfo; + reqInfo.lsLU = static_cast(lsopts); + } else Sel.InfoP = 0; // Do some debugging @@ -558,14 +579,6 @@ const char *XrdCmsNode::do_Locate(XrdCmsRRData &Arg) } } else {Why = "?"; bytes = 0;} -// Get the right options -// - if (Arg.Opts & CmsLocateRequest::kYR_retipv4) - {lsopts |= XrdCmsCluster::LS_IP4; - if (Arg.Opts & CmsLocateRequest::kYR_retipv6) - lsopts |= XrdCmsCluster::LS_IP6; - } else lsopts |= XrdCmsCluster::LS_IP6; - // List the servers // if (!rc) @@ -591,7 +604,7 @@ const char *XrdCmsNode::do_Locate(XrdCmsRRData &Arg) DEBUGR(Why <Status & XrdCmsSelected::isMangr ? 'M' : 'S'); if (sP->Status & Hung) *oP = tolower(*oP); *(oP+1) = (sP->Mask & wfVec ? 'w' : 'r'); - strcpy(oP+2, sP->IPV6); oP += sP->IPV6Len + 2; + strcpy(oP+2, sP->Ident); oP += sP->IdentLen + 2; if (sP->next) *oP++ = ' '; pP = sP; sP = sP->next; delete pP; } @@ -636,7 +649,7 @@ if (lsall) {*oP = (sP->Status & XrdCmsSelected::isMangr ? 'M' : 'S'); if (sP->Mask & pfVec) *oP = tolower(*oP); *(oP+1) = (sP->Mask & wfVec ? 'w' : 'r'); - strcpy(oP+2, sP->IPV6); oP += sP->IPV6Len + 2; + strcpy(oP+2, sP->Ident); oP += sP->IdentLen + 2; if (sP->next) *oP++ = ' '; } pP = sP; sP = sP->next; delete pP; diff --git a/src/XrdCms/XrdCmsNode.hh b/src/XrdCms/XrdCmsNode.hh index 881ca908c36..dbc767b4883 100644 --- a/src/XrdCms/XrdCmsNode.hh +++ b/src/XrdCms/XrdCmsNode.hh @@ -184,10 +184,13 @@ XrdNetAddr netID; XrdCmsNode *Next; time_t DropTime; XrdCmsDrop *DropJob; -int IPV6Len; // 12345678901234567890123456 +char *locName; +short locNLen; +short IPV6Len; // 12345678901234567890123456 char IPV6[INET6_ADDRSTRLEN+10]; // [full_ipv6_address]:123456 -int IPV4Len; // 12345678901234567890123456 +short IPV4Len; // 12345678901234567890123456 char IPV4[INET_ADDRSTRLEN+12]; // [::123.123.123.123]:123456 +char rsv1[4]; SMask_t NodeMask; int NodeID; diff --git a/src/XrdCms/XrdCmsParser.cc b/src/XrdCms/XrdCmsParser.cc index 4fb3b5634ab..2013fd79296 100644 --- a/src/XrdCms/XrdCmsParser.cc +++ b/src/XrdCms/XrdCmsParser.cc @@ -289,7 +289,7 @@ int XrdCmsParser::Decode(const char *Man, CmsRRHdr &hdr, XrdOucBuffer *dBuff, EPNAME("Decode"); static const int mvsz = static_cast(sizeof(kXR_unt32)); kXR_unt32 uval; - int Result, msgval, msglen, dlen = dBuff->Length(); + int Result, msgval, msglen, dlen = dBuff->DataLen(); const char *Path = eInfo->getErrData(), *User = eInfo->getErrUser(); const char *Mgr = (Man ? Man : "?"); char *msg, *data = dBuff->Buffer(); @@ -327,7 +327,7 @@ int XrdCmsParser::Decode(const char *Man, CmsRRHdr &hdr, XrdOucBuffer *dBuff, {XrdOucBuffer *myBuff=dBuff->Highjack(XrdOucEI::Max_Error_Len); if (myBuff) {myBuff->SetLen(msglen, (msglen ? mvsz : 0)); - eInfo->setErrInfo(msglen, ""); + eInfo->setErrInfo(msglen, myBuff); return Result; } } diff --git a/src/XrdCms/XrdCmsRRQ.cc b/src/XrdCms/XrdCmsRRQ.cc index 408cfb88d16..88bc59db09d 100644 --- a/src/XrdCms/XrdCmsRRQ.cc +++ b/src/XrdCms/XrdCmsRRQ.cc @@ -287,6 +287,7 @@ void XrdCmsRRQ::sendLocResp(XrdCmsRRQSlot *lP) static const int ovhd = sizeof(kXR_unt32); XrdCmsSelected *sP; XrdCmsNode *nP; + XrdCmsCluster::CmsLSOpts lsopts; int bytes, nsel; // Send a delay if we timed out @@ -300,7 +301,8 @@ void XrdCmsRRQ::sendLocResp(XrdCmsRRQSlot *lP) // client to wait as this should never happen and the long path is called for. // ASAP responses always respond in with IPv6 addresses or mapped IPv4 ones. // - if (!(sP = Cluster.List(lP->Arg1, XrdCmsCluster::LS_IPO, nsel)) + lsopts = static_cast(lP->Info.lsLU); + if (!(sP = Cluster.List(lP->Arg1, lsopts, nsel)) || (!(bytes = XrdCmsNode::do_LocFmt(databuff,sP,lP->Arg2,lP->Info.rwVec)))) {sendLwtResp(lP); return; diff --git a/src/XrdCms/XrdCmsRRQ.hh b/src/XrdCms/XrdCmsRRQ.hh index 0507711dcc4..c5fb990d626 100644 --- a/src/XrdCms/XrdCmsRRQ.hh +++ b/src/XrdCms/XrdCmsRRQ.hh @@ -54,13 +54,14 @@ char isRW; // True if r/w access wanted char isLU; // True if locate response wanted char minR; // Minimum number of responses for fast redispatch char actR; // Actual number of responses -short Rsvd; +char lsLU; // Lookup options +char Rsvd; SMask_t rwVec; // R/W servers for corresponding path (if isLU is true) XrdCmsRRQInfo() : isLU(0) {} XrdCmsRRQInfo(int rinst, short rnum, kXR_unt32 id, int minQ=0) : Key(0), ID(id), Rinst(rinst), Rnum(rnum), - isRW(0), isLU(0), minR(minQ), actR(0), Rsvd(0), + isRW(0), isLU(0), minR(minQ), actR(0), lsLU(0), Rsvd(0), rwVec(0) {} ~XrdCmsRRQInfo() {} }; @@ -157,7 +158,7 @@ static const int iov_cnt = 2; XrdCms::CmsResponse redrResp; XrdCms::CmsResponse waitResp; union {char hostbuff[288]; - char databuff[XrdCms::CmsLocateRequest::RILen + char databuff[XrdCms::CmsLocateRequest::RHLen *STMax]; }; Info Stats; diff --git a/src/XrdCms/XrdCmsSelect.hh b/src/XrdCms/XrdCmsSelect.hh index decddef7f4f..bd1f0384975 100644 --- a/src/XrdCms/XrdCmsSelect.hh +++ b/src/XrdCms/XrdCmsSelect.hh @@ -94,13 +94,11 @@ class XrdCmsSelected // Argument to List() after select or locate public: XrdCmsSelected *next; -char *Name; SMask_t Mask; int Id; -int Rsvc; +int IdentLen; // 12345678901234567890123456 +char Ident[264]; // [::123.123.123.123]:123456 int Port; -int IPV6Len; // 12345678901234567890123456 -char IPV6[INET6_ADDRSTRLEN+10]; // [::123.123.123.123]:123456 int RefTotW; int RefTotR; int Shrin; // Share intervals used @@ -117,9 +115,8 @@ enum {Disable = 0x0001, isMangr = 0x0100 }; - XrdCmsSelected(const char *sname, XrdCmsSelected *np=0) - {Name = (sname ? strdup(sname) : 0); next=np;} + XrdCmsSelected(XrdCmsSelected *np=0) : next(np) {} - ~XrdCmsSelected() {if (Name) free(Name);} + ~XrdCmsSelected() {} }; #endif diff --git a/src/XrdOuc/XrdOucBuffer.cc b/src/XrdOuc/XrdOucBuffer.cc index 5a234d9d7f5..929c80deb38 100644 --- a/src/XrdOuc/XrdOucBuffer.cc +++ b/src/XrdOuc/XrdOucBuffer.cc @@ -53,7 +53,8 @@ int XrdOucBuffPool::alignit = sysconf(_SC_PAGESIZE); /* C o n s t r u c t o r */ /******************************************************************************/ -XrdOucBuffPool::XrdOucBuffPool(int minsz, int maxsz, int maxh, bool fixh) +XrdOucBuffPool::XrdOucBuffPool(int minsz, int maxsz, + int minh, int maxh, int rate) { int keep, pct, i, n = 0; @@ -65,6 +66,10 @@ XrdOucBuffPool::XrdOucBuffPool(int minsz, int maxsz, int maxh, bool fixh) incBsz = 1024*(1<= 100) keep = maxh; - else {keep = ((maxh * pct) + 55)/100; - if (keep > maxh) keep = maxh; - else if (keep <= 0) keep = 1; - } - bSlot[i].maxbuff = keep; + pct = (slots - i + 1)*100/slots; + if (pct >= 100) keep = maxh; + else {keep = ((maxh * pct) + 55)/100 - i*rate; + if (keep > maxh) keep = maxh; + else if (keep < minh) keep = minh; } + bSlot[i].maxbuff = keep; } } @@ -117,7 +120,7 @@ XrdOucBuffer *XrdOucBuffPool::Alloc(int bsz) // if ((bP = sP->buffFree)) {sP->buffFree = bP->buffNext; - bP->Init(this, snum); + bP->buffPool = this; sP->numbuff--; } else { if ((bP = new XrdOucBuffer(this, snum))) @@ -161,6 +164,7 @@ void XrdOucBuffPool::BuffSlot::Recycle(XrdOucBuffer *bP) // if (numbuff >= maxbuff) {delete bP; return;} bP->dlen = 0; + bP->doff = 0; // Add the buffer to the recycle list // @@ -175,6 +179,24 @@ void XrdOucBuffPool::BuffSlot::Recycle(XrdOucBuffer *bP) /******************************************************************************/ /* X r d O u c B u f f e r M e t h o d s */ /******************************************************************************/ +/******************************************************************************/ +/* P u b l i c C o n s t r u c t o r */ +/******************************************************************************/ + +XrdOucBuffer::XrdOucBuffer(char *buff, int blen) +{ + static XrdOucBuffPool nullPool(0, 0, 0, 0, 0); + +// Initialize the one time buffer +// + data = buff; + dlen = blen; + doff = 0; + size = blen; + slot = 0; + buffPool = &nullPool; +}; + /******************************************************************************/ /* C l o n e */ /******************************************************************************/ @@ -206,7 +228,7 @@ XrdOucBuffer *XrdOucBuffer::Clone(bool trim) XrdOucBuffer *XrdOucBuffer::Highjack(int xsz) { - XrdOucBuffer tempBuff(0,0), *newbP; + XrdOucBuffer tempBuff, *newbP; // Adjust the size to revert highjacked buffer // @@ -221,6 +243,7 @@ XrdOucBuffer *XrdOucBuffer::Highjack(int xsz) tempBuff = *this; *this = *newbP; *newbP = tempBuff; + tempBuff.data = 0; return newbP; } diff --git a/src/XrdOuc/XrdOucBuffer.hh b/src/XrdOuc/XrdOucBuffer.hh index f179ebfddd5..41238fa9af6 100644 --- a/src/XrdOuc/XrdOucBuffer.hh +++ b/src/XrdOuc/XrdOucBuffer.hh @@ -46,7 +46,9 @@ class XrdOucBuffer; //! are typically used in conjunction with the XrdOucErrInfo class. The //! XrdOucBuffPool class defines a pool of buffers and one such object must //! exist for each buffer pool (there can be many such pools). This object -//! manufactures XrdOucBuffer objects. +//! manufactures XrdOucBuffer objects. You can also create XrdOucBuffers +//! without using a buffer pool (i.e. one time buffers). See the XrdOucBuffer +//! constructor for details on how to do this and the associated caveats. //----------------------------------------------------------------------------- class XrdOucBuffPool @@ -84,16 +86,20 @@ inline int MaxSize() const {return maxBsz;} //! @param maxsz - the maximum size a buffer can have and must be >= minsz. //! If it's >minsz it is rounded up to the next minsz increment. //! Buffer sizes are always allocated in minsz increments. +//! @param minh - the minimum number of buffers that should be held in +//! reserve when a buffer is recycled. //! @param maxh - the maximum number of buffers that should be held in //! reserve when a buffer is recycled. The value applies to the //! smallest buffer size and is progessively reduced as the -//! buffer size increases unless fixh is true. -//! @param fixh - when true uses maxb for every buffer size. Otherwise, the -//! maxb value is progressivly reduced for increasing buffers. +//! buffer size increases. If maxh < minh it is set to minh. +//! @param rate - specifies how quickly the hold vale is to be reduced as +//! buffer sizes increase. A rate of 0 specifies a purely linear +//! decrease. Higher values logrithmically decrease the hold. //----------------------------------------------------------------------------- XrdOucBuffPool(int minsz=4096, int maxsz=65536, - int maxh=16, bool fixh=false); + int minh=1, int maxh=16, + int rate=1); //----------------------------------------------------------------------------- //! Destructor - You must not destroy this object prior to recycling all @@ -184,6 +190,14 @@ inline char *Data() const {return data+doff;} inline char *Data(int &dataL) const {dataL = dlen; return data+doff;} +//----------------------------------------------------------------------------- +//! Get the data length. +//! +//! @return The data length. +//----------------------------------------------------------------------------- + +inline int DataLen() {return dlen;} + //----------------------------------------------------------------------------- //! Highjack the buffer contents and reinitialize the original buffer. //! @@ -191,7 +205,7 @@ inline char *Data(int &dataL) const {dataL = dlen; return data+doff;} //! zero, the current size is used. Same size resictions apply //! as for buffer pool Alloc(), above. //! -//! @return !0 - pointer to s usable buffer object which is identical to the +//! @return !0 - pointer to a usable buffer object which is identical to the //! original buffer. The original buffer was reallocated with //! the specified size. //! @return =0 - insufficient memory to allocate a buffer. @@ -199,19 +213,11 @@ inline char *Data(int &dataL) const {dataL = dlen; return data+doff;} XrdOucBuffer *Highjack(int bPsz=0); -//----------------------------------------------------------------------------- -//! Get the data length. -//! -//! @return The data length. -//----------------------------------------------------------------------------- - -inline int Length() {return dlen;} - //----------------------------------------------------------------------------- //! Recycle the buffer. The buffer may be reused in the future. //----------------------------------------------------------------------------- - void Recycle() {buffPool->bSlot[slot].Recycle(this);} +inline void Recycle() {buffPool->bSlot[slot].Recycle(this);} //----------------------------------------------------------------------------- //! Resize the buffer. @@ -232,31 +238,33 @@ inline int Length() {return dlen;} //! @param dataO - the offset of the data in the buffer. //----------------------------------------------------------------------------- -inline void SetLen(int dataL, int dataO=0) - {dlen = dataL; doff = dataO;} +inline void SetLen(int dataL, int dataO=0) {dlen = dataL; doff = dataO;} //----------------------------------------------------------------------------- -//! Constructor +//! Public constructor. You can create one-time buffers not associated with a +//! buffer pool via new to associated your own storage area that will be +//! freed when the buffer is recycled. This may be handy to pass along such a +//! buffer to XrdOucErrInfo in a pinch. A one-time buffer is restricted and +//! the Clone(), Highjack() and Resize() methods will always fail. However, +//! all the other methods will work in the expected way. //! -//! @param pP - pointer to the boffer pool it came from. -//! @param snum - the slot number in the pool where it came from +//! @param buff - pointer to a storage area obtained via malloc and its +//! relatives (e.g. memalign). It will be released via free(). +//! @param blen - the size of the buffer as well as the data length. +//! Use SetLen() to set a new data length if it differs. //----------------------------------------------------------------------------- - XrdOucBuffer(XrdOucBuffPool *pP, int snum) {Init(pP, snum);} - -//----------------------------------------------------------------------------- -//! Destructor -//----------------------------------------------------------------------------- - - ~XrdOucBuffer() {if (data) free(data);} + XrdOucBuffer(char *buff, int blen); private: + XrdOucBuffer(XrdOucBuffPool *pP, int snum) + : data(0), dlen(0), doff(0), size(pP->bSlot[snum].size), + slot(snum), buffPool(pP) {} -inline void Init(XrdOucBuffPool *pP, int snum) - {*data = 0; dlen = 0; doff = 0; - size = pP->bSlot[snum].size; - slot = snum; buffPool = pP; - } + XrdOucBuffer() + : data(0), dlen(0), doff(0), size(0), slot(0), buffPool(0) {} + + ~XrdOucBuffer() {if (data) free(data);} char *data; int dlen; diff --git a/src/XrdOuc/XrdOucErrInfo.hh b/src/XrdOuc/XrdOucErrInfo.hh index 60c3b9bba06..051a3175f39 100644 --- a/src/XrdOuc/XrdOucErrInfo.hh +++ b/src/XrdOuc/XrdOucErrInfo.hh @@ -278,7 +278,7 @@ inline const char *getErrText(int &ecode) //----------------------------------------------------------------------------- inline int getErrTextLen() - {if (dataBuff) return dataBuff->Length(); + {if (dataBuff) return dataBuff->DataLen(); return strlen(ErrInfo.message); }