- moved DoubleTime to nserver.c
- skip ascii nuls in standard handler
This commit is contained in:
14
ascon.c
14
ascon.c
@ -53,16 +53,6 @@ static int CreateSocketAdress(struct sockaddr_in *sockaddrPtr, /* Socket addres
|
||||
return 1;
|
||||
}
|
||||
|
||||
double DoubleTime(void)
|
||||
{
|
||||
struct timeval now;
|
||||
/* the resolution of this function is usec, if the machine supports this
|
||||
and the mantissa of a double is 51 bits or more (31 for sec and 20 for micro)
|
||||
*/
|
||||
gettimeofday(&now, NULL);
|
||||
return now.tv_sec + now.tv_usec / 1e6;
|
||||
}
|
||||
|
||||
void AsconError(Ascon *a, char *msg, int errorno)
|
||||
{
|
||||
static char *stateText[]={
|
||||
@ -455,6 +445,10 @@ int AsconStdHandler(Ascon * a)
|
||||
if (result == 0)
|
||||
return 0;
|
||||
chr = a->lastChar;
|
||||
if (chr == '\0') { /* skip NUL characters */
|
||||
DynStringBackspace(a->rdBuffer); /* remove NUL */
|
||||
return 1;
|
||||
}
|
||||
if (a->replyTerminator != NULL) {
|
||||
if (strchr(a->replyTerminator, chr) != NULL) {
|
||||
a->state = AsconReadDone;
|
||||
|
Reference in New Issue
Block a user