// skip spaces before the elapsed time.
while (*Line==' ') Line++;
- if (!isdigit(*Line)) return(RLRC_Unknown);
// get the elapsed time.
Begin=Line;
Entry->ElapsedTime=0L;
- while (isdigit(*Line)) Entry->ElapsedTime=Entry->ElapsedTime*10+(*Line++-'0');
+ if (*Line=='-')
+ {
+ /*
+ * Negative elapsed time happens in squid (see
+ * http://www.squid-cache.org/mail-archive/squid-users/200711/0192.html)
+ * but no answer were provided as to why it happens. Let's just
+ * assume a zero elapsed time and ignore every following digit.
+ */
+ Line++;
+ if (!isdigit(*Line)) return(RLRC_Unknown);
+ while (isdigit(*Line)) Line++;
+ }
+ else
+ {
+ if (!isdigit(*Line)) return(RLRC_Unknown);
+ while (isdigit(*Line)) Entry->ElapsedTime=Entry->ElapsedTime*10+(*Line++-'0');
+ }
if (*Line!=' ' || Line==Begin) return(RLRC_Unknown);
// get IP address. It can be a fqdn if that option is enabled in squid.