1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Server: Resolves #5738: Check for time drift when the server starts

This commit is contained in:
Laurent Cozic
2021-11-17 12:54:34 +00:00
parent 483b2e769f
commit 0bf323dc63
11 changed files with 90 additions and 67 deletions

View File

@ -44,8 +44,8 @@ const Buffer = require('buffer').Buffer;
if (!exports.dgram) throw new Error('dgram package has not been set!!');
var client = exports.dgram.createSocket("udp4"),
ntpData = new Buffer(48);
var client = exports.dgram.createSocket("udp4");
var ntpData = Buffer.alloc(48); // new Buffer(48);
// RFC 2030 -> LI = 0 (no warning, 2 bits), VN = 3 (IPv4 only, 3 bits), Mode = 3 (Client Mode, 3 bits) -> 1 byte
// -> rtol(LI, 6) ^ rotl(VN, 3) ^ rotl(Mode, 0)