2017-03-06 03:13:09 +01:00
|
|
|
'use strict';
|
|
|
|
|
2017-12-21 03:50:19 +01:00
|
|
|
const { setUnrefTimeout } = require('internal/timers');
|
2016-10-17 20:38:52 +02:00
|
|
|
|
|
|
|
var dateCache;
|
|
|
|
function utcDate() {
|
|
|
|
if (!dateCache) {
|
|
|
|
const d = new Date();
|
|
|
|
dateCache = d.toUTCString();
|
2017-12-21 03:50:19 +01:00
|
|
|
|
|
|
|
setUnrefTimeout(resetCache, 1000 - d.getMilliseconds());
|
2016-10-17 20:38:52 +02:00
|
|
|
}
|
|
|
|
return dateCache;
|
|
|
|
}
|
2017-12-21 03:50:19 +01:00
|
|
|
|
|
|
|
function resetCache() {
|
2016-10-17 20:38:52 +02:00
|
|
|
dateCache = undefined;
|
2017-12-21 03:50:19 +01:00
|
|
|
}
|
2016-10-17 20:38:52 +02:00
|
|
|
|
2017-03-19 20:58:31 +01:00
|
|
|
function ondrain() {
|
|
|
|
if (this._httpMessage) this._httpMessage.emit('drain');
|
|
|
|
}
|
|
|
|
|
2017-03-06 03:13:09 +01:00
|
|
|
module.exports = {
|
2017-03-19 20:58:31 +01:00
|
|
|
outHeadersKey: Symbol('outHeadersKey'),
|
|
|
|
ondrain,
|
2016-10-17 20:38:52 +02:00
|
|
|
utcDate
|
2017-03-06 03:13:09 +01:00
|
|
|
};
|