Changed the format parameters in some of the debug printf to
be more cross-platform enabled.
This commit is contained in:
@@ -82,7 +82,7 @@ CChannel::CChannel(
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "CChannel::CChannel(TcpSocket)- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::CChannel(TcpSocket)- Start, Obj = %0X\n", this);
|
||||
|
||||
// Use Tcp socket
|
||||
m_useTcpSocket = true;
|
||||
@@ -126,7 +126,7 @@ CChannel::CChannel(
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "CChannel::CChannel(DomainSocket)- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::CChannel(DomainSocket)- Start, Obj = %0X\n", this);
|
||||
|
||||
// Do not use Tcp socket
|
||||
m_useTcpSocket = false;
|
||||
@@ -165,7 +165,7 @@ CChannel::~CChannel(void)
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "CChannel::~CChannel- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::~CChannel- Start, Obj = %0X\n", this);
|
||||
|
||||
// Cleanup resources allocated for the object
|
||||
pthread_mutex_destroy(&m_mutex);
|
||||
@@ -276,7 +276,7 @@ CChannel::connectSocket(void)
|
||||
}
|
||||
}
|
||||
|
||||
DbgTrace(1, "CChannel::connectSocket- End, status = %08X\n", retStatus);
|
||||
DbgTrace(1, "CChannel::connectSocket- End, status = %0X\n", retStatus);
|
||||
|
||||
return retStatus;
|
||||
|
||||
@@ -301,7 +301,7 @@ CChannel::init(void)
|
||||
int retStatus = -1;
|
||||
SmartCChannel *pSmartCChannel = NULL;
|
||||
|
||||
DbgTrace(1, "CChannel::init- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::init- Start, Obj = %0X\n", this);
|
||||
|
||||
// Verify the state of the object
|
||||
if (m_state == State_Uninitialized)
|
||||
@@ -333,7 +333,7 @@ CChannel::init(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(0, "CChannel::init- Unable to create channel connection thread, error = %08X\n", threadCreateStatus);
|
||||
DbgTrace(0, "CChannel::init- Unable to create channel connection thread, error = %0X\n", threadCreateStatus);
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
@@ -365,7 +365,7 @@ CChannel::init(void)
|
||||
delete pSmartCChannel;
|
||||
}
|
||||
|
||||
DbgTrace(1, "CChannel::init- End, status = %08X\n", retStatus);
|
||||
DbgTrace(1, "CChannel::init- End, status = %0X\n", retStatus);
|
||||
|
||||
return retStatus;
|
||||
|
||||
@@ -399,7 +399,7 @@ CChannel::connectionThread(
|
||||
RCMapIter iter;
|
||||
ClientReq *pClientReq;
|
||||
|
||||
DbgTrace(1, "CChannel::connectionThread- Start, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- Start, Obj = %0X\n", pCChannel);
|
||||
|
||||
// Set the thread in the detached state so that it is cleaned up when it exits
|
||||
pthread_detach(pthread_self());
|
||||
@@ -410,7 +410,7 @@ CChannel::connectionThread(
|
||||
// Receive and process channel data
|
||||
while (!doneReceivingData)
|
||||
{
|
||||
DbgTrace(2, "CChannel::connectionThread- Receive Loop, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(2, "CChannel::connectionThread- Receive Loop, Obj = %0X\n", pCChannel);
|
||||
|
||||
// Receive the ReqDataPktHdr. Note, if we add other packet types and if the
|
||||
// packet types have different header lengths, then we will need to modify
|
||||
@@ -445,7 +445,7 @@ CChannel::connectionThread(
|
||||
{
|
||||
case ChannelProto::ReqDataCarrierPacketType:
|
||||
|
||||
DbgTrace(2, "CChannel::connectionThread- Processing Request Data Packet, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(2, "CChannel::connectionThread- Processing Request Data Packet, Obj = %0X\n", pCChannel);
|
||||
|
||||
// Allocate a buffer big enough to receive the payload. Allow space to NULL terminate.
|
||||
pRecvBuff = (char*) malloc(payloadLength + 1);
|
||||
@@ -494,7 +494,7 @@ CChannel::connectionThread(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(0, "CChannel::connectionThread- Error, did not find object in map, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(0, "CChannel::connectionThread- Error, did not find object in map, Obj = %0X\n", pCChannel);
|
||||
}
|
||||
|
||||
// Release exclusive access to the CChannel object
|
||||
@@ -502,23 +502,23 @@ CChannel::connectionThread(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "CChannel::connectionThread- Connection aborted prematurely, Obj = %08X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 1Connection aborted prematurely, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- Connection aborted prematurely, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 1Connection aborted prematurely, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 1bytesReceived = %d\n", bytesReceived);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 1payloadLength = %d\n", payloadLength);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 1errno = %d\n", errno);
|
||||
//printf("bytesReceived = %d, payloadLength = %d\n", bytesReceived, payloadLength);
|
||||
//printf("CChannel::connectionThread- 1Connection aborted prematurely, Obj = %08X\n", pCChannel);
|
||||
//printf("CChannel::connectionThread- 1Connection aborted prematurely, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "CChannel::connectionThread- Connection aborted prematurely, Obj = %08X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 2Connection aborted prematurely, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- Connection aborted prematurely, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 2Connection aborted prematurely, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 2errno = %d\n", errno);
|
||||
//printf("Socket error = %d\n", errno);
|
||||
//printf("CChannel::connectionThread- 2Connection aborted prematurely, Obj = %08X\n", pCChannel);
|
||||
//printf("CChannel::connectionThread- 2Connection aborted prematurely, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
}
|
||||
|
||||
@@ -528,14 +528,14 @@ CChannel::connectionThread(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(0, "CChannel::connectionThread- Unable to allocate receive buffer, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(0, "CChannel::connectionThread- Unable to allocate receive buffer, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case ChannelProto::ReqErrorCarrierPacketType:
|
||||
|
||||
DbgTrace(1, "CChannel::connectionThread- Processing Request Error Packet, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- Processing Request Error Packet, Obj = %0X\n", pCChannel);
|
||||
|
||||
// Acquire exclusive access to the CChannel object
|
||||
pthread_mutex_lock(&pCChannel->m_mutex);
|
||||
@@ -551,7 +551,7 @@ CChannel::connectionThread(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(0, "CChannel::connectionThread- Error, did not find object in map, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(0, "CChannel::connectionThread- Error, did not find object in map, Obj = %0X\n", pCChannel);
|
||||
}
|
||||
|
||||
// Release exclusive access to the CChannel object
|
||||
@@ -560,36 +560,36 @@ CChannel::connectionThread(
|
||||
|
||||
default:
|
||||
|
||||
DbgTrace(0, "CChannel::connectionThread- Unknown Packet Type, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(0, "CChannel::connectionThread- Unknown Packet Type, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "CChannel::connectionThread- Unable to obtain payload length, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- Unable to obtain payload length, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "CChannel::connectionThread- The channel connection was terminated, Obj = %08X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 3The channel connection was terminated, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- The channel connection was terminated, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 3The channel connection was terminated, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 3bytesReceived = %d\n", bytesReceived);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 3expected = %d\n", ReqDataPktHdrTemplate.length());
|
||||
//DbgTrace(0, "CChannel::connectionThread- 3errno = %d\n", errno);
|
||||
//printf("bytesReceived = %d, expected = %d\n", bytesReceived, ReqDataPktHdrTemplate.length());
|
||||
//printf("CChannel::connectionThread- 3The channel connection was terminated, Obj = %08X\n", pCChannel);
|
||||
//printf("CChannel::connectionThread- 3The channel connection was terminated, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "CChannel::connectionThread- The channel connection was aborted, Obj = %08X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 4The channel connection was aborted, Obj = %08X\n", pCChannel);
|
||||
DbgTrace(1, "CChannel::connectionThread- The channel connection was aborted, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 4The channel connection was aborted, Obj = %0X\n", pCChannel);
|
||||
//DbgTrace(0, "CChannel::connectionThread- 4errno = %d\n", errno);
|
||||
//printf("Socket error = %d\n", errno);
|
||||
//printf("CChannel::connectionThread- 4The channel connection was aborted, Obj = %08X\n", pCChannel);
|
||||
//printf("CChannel::connectionThread- 4The channel connection was aborted, Obj = %0X\n", pCChannel);
|
||||
doneReceivingData = true;
|
||||
}
|
||||
}
|
||||
@@ -651,7 +651,7 @@ CChannel::closeChannel(void)
|
||||
//=======================================================================--
|
||||
{
|
||||
|
||||
DbgTrace(1, "CChannel::closeChannel- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::closeChannel- Start, Obj = %0X\n", this);
|
||||
|
||||
// Acquire CChannel mutex
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
@@ -697,7 +697,7 @@ CChannel::ok(void)
|
||||
{
|
||||
bool retStatus;
|
||||
|
||||
DbgTrace(1, "CChannel::ok- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::ok- Start, Obj = %0X\n", this);
|
||||
|
||||
// Return true if connected
|
||||
if (m_state == State_Connected)
|
||||
@@ -705,7 +705,7 @@ CChannel::ok(void)
|
||||
else
|
||||
retStatus = false;
|
||||
|
||||
DbgTrace(1, "CChannel::ok- End, retStatus = %08X\n", retStatus);
|
||||
DbgTrace(1, "CChannel::ok- End, retStatus = %0X\n", retStatus);
|
||||
|
||||
return retStatus;
|
||||
|
||||
@@ -729,12 +729,12 @@ CChannel::allocReqId(void)
|
||||
{
|
||||
uint32_t allocatedId;
|
||||
|
||||
DbgTrace(1, "CChannel::allocReqId- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::allocReqId- Start, Obj = %0X\n", this);
|
||||
|
||||
// Perform atomic operation
|
||||
allocatedId = InterlockedIncrement(&m_reqIdAllocator);
|
||||
|
||||
DbgTrace(1, "CChannel::allocReqId- End, allocatedId = %08X\n", allocatedId);
|
||||
DbgTrace(1, "CChannel::allocReqId- End, allocatedId = %0X\n", allocatedId);
|
||||
|
||||
return allocatedId;
|
||||
|
||||
@@ -768,7 +768,7 @@ CChannel::submitReq(
|
||||
unsigned long totalBytesSent = 0;
|
||||
unsigned long bytesToSend = sizeof(reqDataPktHdr) + clientDataLen;
|
||||
|
||||
DbgTrace(1, "CChannel::submitReq- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::submitReq- Start, Obj = %0X\n", this);
|
||||
|
||||
// Acquire exclusive access to the channel object
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
@@ -783,7 +783,7 @@ CChannel::submitReq(
|
||||
if (!insertResult.second)
|
||||
{
|
||||
// Insertion failed
|
||||
DbgTrace(0, "CChannel::submitReq- Unable to insert ClientReq into ClientReqMap, Obj = %08X\n", this);
|
||||
DbgTrace(0, "CChannel::submitReq- Unable to insert ClientReq into ClientReqMap, Obj = %0X\n", this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -871,7 +871,7 @@ CChannel::submitReq(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(0, "CChannel::submitReq- Error building Req Data Pkt Header, Obj = %08X\n", this);
|
||||
DbgTrace(0, "CChannel::submitReq- Error building Req Data Pkt Header, Obj = %0X\n", this);
|
||||
|
||||
// Remove ClientReq from the ClientReqMap
|
||||
RCMapIter iter = m_rcMap.find(reqId);
|
||||
@@ -889,13 +889,13 @@ CChannel::submitReq(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "CChannel::submitReq- Channel not connected, state = %08X\n", m_state);
|
||||
DbgTrace(1, "CChannel::submitReq- Channel not connected, state = %0X\n", m_state);
|
||||
}
|
||||
|
||||
// Release exclusive access to the channel object
|
||||
pthread_mutex_unlock(&m_mutex);
|
||||
|
||||
DbgTrace(1, "CChannel::submitReq- End, retStatus = %08X\n", retStatus);
|
||||
DbgTrace(1, "CChannel::submitReq- End, retStatus = %0X\n", retStatus);
|
||||
|
||||
return retStatus;
|
||||
|
||||
@@ -918,7 +918,7 @@ CChannel::removeReq(
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "CChannel::removeReq- Start, Obj = %08X\n", this);
|
||||
DbgTrace(1, "CChannel::removeReq- Start, Obj = %0X\n", this);
|
||||
|
||||
// Acquire exclusive access to the channel object
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
|
||||
Reference in New Issue
Block a user