Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bb91834
http: move utcDate to internal/http.js
jasnell Oct 17, 2016
c6472e7
tls: add tlsSocket.disableRenegotiation()
jasnell Nov 4, 2016
a22543c
deps: add nghttp2 dependency
jasnell Jul 17, 2017
ea75860
http2: introducing HTTP/2
jasnell Jul 17, 2017
837dfe4
http2: add tests and benchmarks
jasnell Jul 17, 2017
e4b9149
http2: remove redundant return in test
jasnell Jul 17, 2017
8357bd0
http2: fix documentation nits
jasnell Jul 17, 2017
295e4b1
doc: include http2.md in all.md
jasnell Jul 17, 2017
9cb0611
test: fix flakiness in test-http2-client-upload
jasnell Jul 18, 2017
fefe2cb
test: fix flaky test-http2-client-unescaped-path on osx
jasnell Jul 18, 2017
a93b3b8
http2: fix abort when client.destroy inside end event
jasnell Jul 19, 2017
2289352
http2: refinement and test for socketError
jasnell Jul 19, 2017
d74da3a
http2: fix socketOnTimeout and a segfault
jasnell Jul 19, 2017
07758c8
http2: add range support for respondWith{File|FD}
jasnell Jul 22, 2017
0d8bf4c
http2: doc and fixes to the Compatibility API
mcollina Jul 24, 2017
2db82e0
http2: make writeHead behave like HTTP/1.
mcollina Jul 24, 2017
6bc7cc2
http2: address initial pr feedback
jasnell Jul 31, 2017
0a5fe92
http2: refactor trailers API
jasnell Jul 31, 2017
7c5825b
http2: get trailers working with the compat api
jasnell Jul 31, 2017
0e13eb6
http2: use static allocated arrays
jasnell Aug 1, 2017
a2045e9
http2: minor cleanup
jasnell Aug 1, 2017
c9c9e92
http2: fix documentation errors
jasnell Aug 1, 2017
ea2a35f
http2: add some doc detail for invalid header chars
jasnell Aug 1, 2017
69a0783
http2: fix compilation error after V8 update
jasnell Aug 3, 2017
ba2744e
http2: fix linting after rebase
jasnell Aug 3, 2017
c58115d
http2: fix flakiness in timeout
jasnell Aug 3, 2017
79e14a9
http2: rename some nghttp2 stream flags
kjin Aug 5, 2017
38f55ea
test: add crypto check to http2 tests
danbev Aug 7, 2017
ede1161
doc: fix http2 sample code for http2.md
kakts Aug 7, 2017
ea3c8c7
doc: explain browser support of http/2 without SSL
giltayar Aug 7, 2017
e344b91
src,http2: DRY header/trailer handling code up
addaleax Aug 8, 2017
70f7c54
test: increase http2 coverage
michaalbert Aug 8, 2017
1129943
http2: improve perf of passing headers to C++
addaleax Aug 9, 2017
5db4971
src: remove unused http2_socket_buffer from env
addaleax Aug 10, 2017
a6c1571
http2: use per-environment buffers
addaleax Aug 10, 2017
01bada5
http2: name padding buffer fields
addaleax Aug 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
http: move utcDate to internal/http.js
PR-URL: #14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
jasnell committed Aug 13, 2017
commit bb91834ea430b12e8bbd5f2934dbd852220be174
19 changes: 2 additions & 17 deletions lib/_http_outgoing.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

const assert = require('assert').ok;
const Stream = require('stream');
const timers = require('timers');
const util = require('util');
const internalUtil = require('internal/util');
const internalHttp = require('internal/http');
const Buffer = require('buffer').Buffer;
const common = require('_http_common');
const checkIsHttpToken = common._checkIsHttpToken;
Expand All @@ -36,6 +36,7 @@ const nextTick = require('internal/process/next_tick').nextTick;

const CRLF = common.CRLF;
const debug = common.debug;
const utcDate = internalHttp.utcDate;

var RE_FIELDS =
/^(?:Connection|Transfer-Encoding|Content-Length|Date|Expect|Trailer|Upgrade)$/i;
Expand Down Expand Up @@ -63,24 +64,8 @@ function isCookieField(s) {
return true;
}

var dateCache;
function utcDate() {
if (!dateCache) {
var d = new Date();
dateCache = d.toUTCString();
timers.enroll(utcDate, 1000 - d.getMilliseconds());
timers._unrefActive(utcDate);
}
return dateCache;
}
utcDate._onTimeout = function _onTimeout() {
dateCache = undefined;
};


function noopPendingOutput(amount) {}


function OutgoingMessage() {
Stream.call(this);

Expand Down
17 changes: 17 additions & 0 deletions lib/internal/http.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
'use strict';

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;
};

function ondrain() {
if (this._httpMessage) this._httpMessage.emit('drain');
}

module.exports = {
outHeadersKey: Symbol('outHeadersKey'),
ondrain,
utcDate
};