This is the first working version of the new logging system. Some work
in fine tuning still needs to be done. But is reasonably OK now.
This commit is contained in:
@ -81,8 +81,7 @@ int defaultPrepareTxn(pAsyncProtocol p, pAsyncTxn txn, const char *cmd,
|
||||
/* outgoing command is correctly terminated */
|
||||
txn->out_buf = malloc(cmd_len + 1);
|
||||
if (txn->out_buf == NULL) {
|
||||
SICSLogWrite("Out of memory in AsyncProtocol::defaultPrepareTxn",
|
||||
eError);
|
||||
Log(ERROR,"ASQUIO","%s","Out of memory in AsyncProtocol::defaultPrepareTxn");
|
||||
return 0;
|
||||
}
|
||||
memcpy(txn->out_buf, cmd, cmd_len + 1);
|
||||
@ -91,7 +90,7 @@ int defaultPrepareTxn(pAsyncProtocol p, pAsyncTxn txn, const char *cmd,
|
||||
int tlen = strlen(term);
|
||||
txn->out_buf = malloc(cmd_len + tlen + 1);
|
||||
if (txn->out_buf == NULL) {
|
||||
SICSLogWrite("Out of memory in AsyncProtocol::defaultPrepareTxn",
|
||||
Log(ERROR,"ASQUIO","%s","Out of memory in AsyncProtocol::defaultPrepareTxn",
|
||||
eError);
|
||||
return 0;
|
||||
}
|
||||
@ -174,7 +173,7 @@ static char *decodeTerminator(char *code)
|
||||
count = strlen(code);
|
||||
pResult = (char *) malloc(count + 1);
|
||||
if (!pResult) {
|
||||
SICSLogWrite("Out of memory in AsyncProtocol::decodeTerminator",
|
||||
Log(ERROR,"ASQUIO","%s","Out of memory in AsyncProtocol::decodeTerminator",
|
||||
eError);
|
||||
return NULL;
|
||||
}
|
||||
@ -329,7 +328,7 @@ pAsyncProtocol AsyncProtocolCreate(SicsInterp * pSics,
|
||||
|
||||
self = (pAsyncProtocol) malloc(sizeof(AsyncProtocol));
|
||||
if (self == NULL) {
|
||||
SICSLogWrite("Out of memory in AsyncProtocolCreate", eError);
|
||||
Log(ERROR,"ASQUIO","%s","Out of memory in AsyncProtocolCreate");
|
||||
return NULL;
|
||||
}
|
||||
memset(self, 0, sizeof(AsyncProtocol));
|
||||
@ -340,7 +339,7 @@ pAsyncProtocol AsyncProtocolCreate(SicsInterp * pSics,
|
||||
pKFunc = AsyncProtocolKill;
|
||||
iRet = AddCommand(pSics, (char *) protocolName, pFunc, pKFunc, self);
|
||||
if (!iRet) {
|
||||
SICSLogWrite("AddCommand failed in AsyncProtocolCreate", eError);
|
||||
Log(ERROR,"ASQUIO","%s","AddCommand failed in AsyncProtocolCreate");
|
||||
AsyncProtocolKill(self);
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user