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