HarryR / HarryR/logpipe

Fix timestamp support across platforms, be consistent

Open
#14 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The meta structure includes a timestamp field, however its capabilities are limited by the platforms `struct tm`, the current problems are:
- No milliseconds (required for Squid)
- No GMT offset on Windows and Solaris
- Portable netbsd strptime.c doesn't support `%s` (epoch timestamp)

To ensure that both Squid and Apache logfiles can pass through without modification on both Windows and Linux the timestamp handling needs to be improved and made consistent across platforms.

The outcome of this will be to:
- Parse from multiple formats into a UTC timestamp
- Save original timezone
- Support for milliseconds
- Output to multiple formats, including milliseconds and timezones

Squid uses UTC timestamps with milliseconds, Apache uses HTTP dates with timezone and others like Wikimedia's Cache log format use ISO 8601 dates with optional milliseconds but don't include a timezone.

To ensure correctness and cross-platform portability the first step is to create a series of tests which identify, highlight and verify the time parsing capabilities that we currently have.

The next step is to devise a data structure which contains all the necessary fields, and design utility functions which hide the underlying date and time parsing.

One option available is to extend the portable strptime to support this new data structure and the required fields etc. so the same code can be used across multiple platforms.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.