Chirp::~Chirp() { // if we're a client, disconnect (let server know) if (m_client) remoteInit(false); if (!m_sharedMem) { restoreBuffer(); delete[] m_buf; } delete[] m_procTable; }
Chirp::~Chirp() { log("pixydebug: Chirp::~Chirp()\n"); // if we're a client, disconnect (let server know) if (m_client) remoteInit(false); if (!m_sharedMem) { restoreBuffer(); delete[] m_buf; } delete[] m_procTable; log("pixydebug: Chirp::~Chirp() returned\n"); }
int Chirp::useBuffer(uint8_t *buf, uint32_t len) { int res; if (m_bufSave==NULL) { m_bufSave = m_buf; m_buf = buf; } else if (buf!=m_buf) return CRP_RES_ERROR_MEMORY; m_len = len-m_headerLen; if (!m_call) // if we're not a call, we're extra data, so we need to send { res = sendChirpRetry(CRP_XDATA, 0); restoreBuffer(); // restore buffer immediately! if (res!=CRP_RES_OK) // convert call into response return res; } return CRP_RES_OK; }