-/* @(#) $Id$ */
+/* @(#) $Id: ./src/logcollector/read_multiline.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2010 Trend Micro Inc.
* All right reserved.
linesgot++;
/* Getting the last occurence of \n */
- if ((p = strrchr(str, '\n')) != NULL)
+ if ((p = strrchr(str, '\n')) != NULL)
{
*p = '\0';
}
-
+
/* If we didn't get the new line, because the
* size is large, send what we got so far.
*/
debug1("%s: Message not complete. Trying again: '%s'", ARGV0,str);
fsetpos(logff[pos].fp, &fp_pos);
break;
- }
-
+ }
+
#ifdef WIN32
if ((p = strrchr(str, '\r')) != NULL)
{
*p = '\0';
}
#endif
-
+
debug2("%s: DEBUG: Reading message: '%s'", ARGV0, str);
-
+
/* Adding to buffer. */
buffer_size = strlen(buffer);
strncpy(buffer + buffer_size, str, OS_MAXSTR - buffer_size -2);
-
+
if(linesgot < linecount)
{
continue;
}
-
+
/* Sending message to queue */
if(drop_it == 0)
}
__ms = 0;
}
-
+
fgetpos(logff[pos].fp, &fp_pos);
continue;
}
- return(NULL);
+ return(NULL);
}
/* EOF */