| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hdbADP::DeltaOriginateObj | (hdbObjRepos*,hzChain&,) |
Declared in file: hzDatabase.h
Defined in file : hdbADP.cpp
Function Logic:
Function body:
hzEcode hdbADP::DeltaOriginateObj (hdbObjRepos* pObjRepos)hzChain& Zd,
{
_hzfunc("hdbADP::DeltaOriginateObj") ;
hzChain::BlkIter bi ; // Chain block iterator
hzChain X ; // Chain to send to DS
int32_t nSend ; // Bytes to send
int32_t nSent ; // Bytes sent
uint32_t nSIL ; // Serial integer len
hzEcode rc = E_OK ; // Return code
char outBuf[64]; // Used to state repos id etc
if (m_eDeltaMode == DELTA_MODE_NULL)
return E_OK ;
// Compile delta header
nSend = sprintf(outBuf, "a=%s;r=%s;", *m_appName, pObjRepos->txtName()) ;
nSend += 2;
nSend += Zd.Size() ;
// Write command
X.AddByte(DELTA_ORIG_OBJECT) ;
// Write nLen
WriteSerialUINT32(X, nSIL, nSend) ;
// Write delta header
X << outBuf ;
// Write delta
X << Zd ;
threadLog(X) ;
// Write to socket
for (bi = X ; rc == E_OK && bi.Data() ; bi.Advance())
{
nSent = write(m_unixSock, bi.Data(), bi.Size()) ;
if (nSent < 0)
rc = hzerr(E_SENDFAIL, "Send error (errno=%d)\n", errno) ;
}
return E_OK ;
}