0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

28 Commits

Author SHA1 Message Date
Roman Reiss
fb8811d95e lib,test: fix whitespace issues
PR-URL: https://github.com/nodejs/io.js/pull/1971
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-15 16:37:37 +02:00
Evan Lucas
d4726cde57 http,net,tls: return this from setTimeout methods
Modifies the setTimeout methods for the following prototypes:

- http.ClientRequest
- http.IncomingMessage
- http.OutgoingMessage
- http.Server
- https.Server
- net.Socket
- tls.TLSSocket

Previously, the above functions returned undefined. They now return
`this`. This is useful for chaining function calls.

PR-URL: https://github.com/nodejs/io.js/pull/1699
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-05-16 07:17:41 +02:00
Yosuke Furukawa
19ffb5cf1c lib: fix eslint styles
PR-URL: https://github.com/iojs/io.js/pull/1539
Fixes: https://github.com/iojs/io.js/issues/1253
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2015-05-09 12:10:02 +09:00
Glen Keane
5e825d1073 tracing: add lttng support for tracing on linux
This commit adds the ability to enable userspace tracing with lttng
in io.js. It adds tracepoints for all the equivalent dtrace and ETW
tracepoints. To use these tracepoints enable --with-lttng on linux.

PR-URL: https://github.com/iojs/io.js/pull/702
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ryan Graham <ryan@strongloop.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2015-02-09 18:06:57 +01:00
cjihrig
6ac8bdc0ab lib: reduce util.is*() usage
Many of the util.is*() methods used to check data types
simply compare against a single value or the result of
typeof. This commit replaces calls to these methods with
equivalent checks. This commit does not touch calls to the
more complex methods (isRegExp(), isDate(), etc.).

Fixes: https://github.com/iojs/io.js/issues/607
PR-URL: https://github.com/iojs/io.js/pull/647
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-31 23:47:29 -05:00
cjihrig
804e7aa9ab lib: use const to define constants
This commit replaces a number of var statements throughout
the lib code with const statements.

PR-URL: https://github.com/iojs/io.js/pull/541
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 16:21:31 -05:00
isaacs
3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Ben Noordhuis
21130c7d6f lib: turn on strict mode
Turn on strict mode for the files in the lib/ directory.  It helps
catch bugs and can have a positive effect on performance.

PR-URL: https://github.com/node-forward/node/pull/64
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-11-22 17:23:30 +01:00
Ben Noordhuis
150d6f1249 lib: http: poison parser references after freeing
Make it a little harder to slip in use-after-free bugs by nulling out
references to the parser object after handing it off to freeParser().

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-05 09:34:37 -07:00
Alex Kocharin
b9960eefc2 http: fix bailout for writeHead
Reported-by: Jackson Tian <shyvo1987@gmail.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-18 16:21:03 -07:00
Fedor Indutny
73343d5cee http: remove unused code block
fix #7769

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-27 17:00:10 +04:00
Timothy J Fontaine
1a09da6ec2 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/v8/src/api.cc
	deps/v8/src/unicode-inl.h
	deps/v8/src/unicode.h
	lib/_stream_readable.js
	lib/http.js
	src/cares_wrap.cc
	src/node.cc
	src/node_crypto.cc
	src/node_dtrace.cc
	src/node_file.cc
	src/node_stat_watcher.cc
	src/node_version.h
	src/process_wrap.cc
	src/string_bytes.cc
	src/string_bytes.h
	src/udp_wrap.cc
	src/util.h
	test/simple/test-buffer.js
	test/simple/test-stream2-compatibility.js
2014-06-10 19:36:04 -04:00
Yazhong Liu
ab50fad63b http: add 308 status_code, see RFC7238
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-08 10:02:25 -07:00
Yuki KAN
006d42786e lib: use triple equals
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-02 02:12:18 -07:00
David Björklund
b105997193 http: avoid duplicate keys in writeHead
Use setHeader in writeHead to avoid sending duplicate headers

Fixes #5036
2014-02-19 09:24:16 -08:00
Patrik Stutz
54910044b3 http: add statusMessage
Now the status message can be set via req.statusMessage = 'msg';
2013-10-16 18:34:52 -07:00
isaacs
085dd30e93 http: provide backpressure for pipeline flood
If a client sends a lot more pipelined requests than we can handle, then
we need to provide backpressure so that the client knows to back off.
Do this by pausing both the stream and the parser itself when the
responses are not being read by the downstream client.

Fix GH-6214
2013-10-16 11:01:33 -07:00
isaacs
7c9b607048 http: Consistent 'finish' event semantics
In other Writable streams, the 'finish' event means that all of the data
was written, and flushed to the underlying system.

The 'prefinish' event means that end() was called, and all of the data
was processed, but not necessarily completely flushed.

This change brings the http OutgoingMessage classes more in sync with
the other Writable classes throughout Node.

Unfortunately, this change highlights an issue with http
IncomingMessages, where the _dump() method will not actually pull the
data off the wire.  This is a minor issue that is typically only
relevant in test cases, and will be addressed in the next commit.
2013-08-15 15:05:41 -07:00
isaacs
da93d6adfb http: Add write()/end() callbacks 2013-08-15 15:05:41 -07:00
isaacs
967b5dbb45 http: Use streams3 directly, not .ondata/end 2013-08-08 13:01:09 -07:00
isaacs
22c68fdc1d src: Replace macros with util functions 2013-08-01 15:08:01 -07:00
Ben Noordhuis
0330bdf519 lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks
across the code base.
2013-07-24 21:49:35 +02:00
isaacs
831de7cbb9 http: Use OOP for OutgoingMessage._finish
Sniffing instanceof a child class in the parent class's method
is Doing It Wrong.
2013-07-09 22:31:11 -07:00
Trevor Norris
278183a902 {stream,udp,tls}_wrap: remove unused offset/length
The function arguments offset and length are now no longer used since
all I/O requests now use discretely allocated memory.
2013-07-03 15:03:41 -07:00
isaacs
adf9b67e59 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/v8/build/common.gypi
	deps/v8/src/frames.h
	deps/v8/src/runtime.cc
	deps/v8/test/mjsunit/debug-set-variable-value.js
	lib/http.js
	src/node_version.h
2013-06-25 11:12:33 -07:00
isaacs
ba048e72b0 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	configure
	deps/uv/ChangeLog
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/v8/src/isolate.cc
	deps/v8/src/version.cc
	lib/http.js
	src/node_version.h
2013-05-27 14:46:52 -07:00
Trevor Norris
88333f7ace http: don't slice unless necessary
The incoming Buffer was being sliced just to possibly not be used.
Instead place the .slice inside the conditional to not be created unless
necessary.
2013-05-15 15:10:56 -07:00
Timothy J Fontaine
6717fdccb4 http: move Server and ServerResponse out 2013-04-17 00:08:28 +02:00