logg excess and unsolicited characters
r3756 | dcl | 2012-10-02 17:12:06 +1000 (Tue, 02 Oct 2012) | 1 line
This commit is contained in:
24
asyncqueue.c
24
asyncqueue.c
@@ -121,6 +121,12 @@ static int AQ_Reconnect(pAsyncQueue self)
|
|||||||
char line[132];
|
char line[132];
|
||||||
|
|
||||||
iRet = NETReconnect(self->pSock);
|
iRet = NETReconnect(self->pSock);
|
||||||
|
/*
|
||||||
|
* iRet can take the following values:
|
||||||
|
* -1: The request failed
|
||||||
|
* 0: The request is still in progress
|
||||||
|
* +1: The request succeeded
|
||||||
|
*/
|
||||||
if (iRet <= 0) {
|
if (iRet <= 0) {
|
||||||
snprintf(line, 132, "Disconnect on AsyncQueue '%s'", self->queue_name);
|
snprintf(line, 132, "Disconnect on AsyncQueue '%s'", self->queue_name);
|
||||||
SICSLogWrite(line, eStatus);
|
SICSLogWrite(line, eStatus);
|
||||||
@@ -347,13 +353,25 @@ static int MyCallback(void* context, int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i < nchars - 1) {
|
if (i < nchars - 1) {
|
||||||
SICSLogWrite("ERROR: excess chars in AsyncQueue", eError);
|
char line[132];
|
||||||
|
int excess = nchars - 1 - i;
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
snprintf(line , sizeof(line)-1, "ERROR: %d excess chars in AsyncQueue", excess);
|
||||||
|
SICSLogWriteTime(line, eError, &tv);
|
||||||
|
SICSLogWriteHexTime(&reply[i], excess, eError, &tv);
|
||||||
/* TODO: handle unsolicited */
|
/* TODO: handle unsolicited */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SICSLogWrite("ERROR: unsolicited input in AsyncQueue", eError);
|
char line[132];
|
||||||
/* TODO: handle unsolicited input */
|
int excess = nchars - 1 - i;
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
snprintf(line , sizeof(line)-1, "ERROR: %d unsolicited chars in AsyncQueue", excess);
|
||||||
|
SICSLogWriteTime(line, eError, &tv);
|
||||||
|
SICSLogWriteHexTime(&reply[i], excess, eError, &tv);
|
||||||
|
/* TODO: handle unsolicited input */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user