[03:00:59] <Test1> list
[03:00:59] <*listsockets> +--------------+-------------------------+----------+-----+----------------+-----------------+-------+-------+
[03:00:59] <*listsockets> | Name | Created | State | SSL | Local | Remote | In | Out |
[03:00:59] <*listsockets> +--------------+-------------------------+----------+-----+----------------+-----------------+-------+-------+
[03:00:59] <*listsockets> | _LISTENER | 1970-01-22 00:15:44.884 | Listener | No | :: 9999 | | 0 B | 0 B |
[03:00:59] <*listsockets> | USR::KindOne | 1970-01-22 00:15:46.303 | Inbound | No | 127.0.0.1 9999 | 127.0.0.1 54337 | 203 B | 1 KiB |
[03:00:59] <*listsockets> +--------------+-------------------------+----------+-----+----------------+-----------------+-------+-------+
```Juest``` reported the bug in```#znc```.
I did a git bisect and finally found the offending commit after a few hours:
42fdf9b49f374849d4177f6e185e70a6541f7d31
```
[03:00:59] <Test1> list
[03:00:59] <*listsockets> +--------------+-------------------------+----------+-----+----------------+-----------------+-------+-------+
[03:00:59] <*listsockets> | Name | Created | State | SSL | Local | Remote | In | Out |
[03:00:59] <*listsockets> +--------------+-------------------------+----------+-----+----------------+-----------------+-------+-------+
[03:00:59] <*listsockets> | _LISTENER | 1970-01-22 00:15:44.884 | Listener | No | :: 9999 | | 0 B | 0 B |
[03:00:59] <*listsockets> | USR::KindOne | 1970-01-22 00:15:46.303 | Inbound | No | 127.0.0.1 9999 | 127.0.0.1 54337 | 203 B | 1 KiB |
[03:00:59] <*listsockets> +--------------+-------------------------+----------+-----+----------------+-----------------+-------+-------+
```
<!-- github-sync-id:2305270250 -->
Previously, millitime() used gettimeofday to get the current time. With the above update, it is switched to std::chrono::steady_clock::now(). That one uses the monotonic clock and doesn't produce sensible values when interpreted as a wall clock timestamp.
Previously, `millitime()` used `gettimeofday` to get the current time. With the above update, it is switched to `std::chrono::steady_clock::now()`. That one uses the monotonic clock and doesn't produce sensible values when interpreted as a wall clock timestamp.
<!-- github-comment-id:2122790826 -->
// https://github.com/znc/znc/issues/1910
TEST_F(ZNCTest, ListsocketsModule) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = LoginClient();
client.Write("znc loadmod listsockets");
client.ReadUntil("Loaded module");
client.Write("PRIVMSG *listsockets :list");
// Look for year 20xx, not 1970.
client.ReadUntil("| _LISTENER | 20");
}
Here is a test for when it gets fixed.
```
$ test/integration/inttest --gtest_filter=ZNCTest.ListsocketsModule
```
```
// https://github.com/znc/znc/issues/1910
TEST_F(ZNCTest, ListsocketsModule) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = LoginClient();
client.Write("znc loadmod listsockets");
client.ReadUntil("Loaded module");
client.Write("PRIVMSG *listsockets :list");
// Look for year 20xx, not 1970.
client.ReadUntil("| _LISTENER | 20");
}
```
<!-- github-comment-id:2124858421 -->
// TODO: Fix before Year 2100 - https://xkcd.com/1782/
// https://github.com/znc/znc/issues/1910
TEST_F(ZNCTest, ListsocketsModule) {
...
Add a TODO and deal with it later.
```
// TODO: Fix before Year 2100 - https://xkcd.com/1782/
// https://github.com/znc/znc/issues/1910
TEST_F(ZNCTest, ListsocketsModule) {
...
```
<!-- github-comment-id:2128318484 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Juestreported the bug in#znc.I did a git bisect and finally found the offending commit after a few hours:
42fdf9b49fPreviously,
millitime()usedgettimeofdayto get the current time. With the above update, it is switched tostd::chrono::steady_clock::now(). That one uses the monotonic clock and doesn't produce sensible values when interpreted as a wall clock timestamp.Here is a test for when it gets fixed.
This test will break in year 2100 though :(
Add a TODO and deal with it later.