Commit Graph

7911 Commits (74c08403d89366d184089bee9a2ccd4e46cd05c4)

Author SHA1 Message Date
isaacs 74c08403d8 lint 2013-02-22 16:30:27 -08:00
isaacs 27d1babaae streams: Pre-emptively buffer readables up to the highWaterMark
Also, this adds a test that guarantees that the ordering of several
push() calls in a row is always preserved in synchronous readable streams
2013-02-22 11:24:05 -08:00
isaacs a63c28e6eb stream: Return false from push() more properly
There are cases where a push() call would return true, even though
the thing being pushed was in fact way way larger than the high
water mark, simply because the 'needReadable' was already set, and
would not get unset until nextTick.

In some cases, this could lead to an infinite loop of pushing data
into the buffer, never getting to the 'readable' event which would
unset the needReadable flag.

Fix by splitting up the emitReadable function, so that it always
sets the flag on this tick, even if it defers until nextTick to
actually emit the event.

Also, if we're not ending or already in the process of reading, it
now calls read(0) if we're below the high water mark.  Thus, the
highWaterMark value is the intended amount to buffer up to, and it
is smarter about hitting the target.
2013-02-21 15:23:18 -08:00
isaacs 3b2e9d2648 stream: remove lowWaterMark feature
It seems like a good idea on the face of it, but lowWaterMarks are
actually not useful, and in practice should always be set to zero.

It would be worthwhile for writers if we actually did some kind of
writev() type of thing, but actually this just delays calling write()
and the overhead of doing a bunch of Buffer copies is not worth the
slight benefit of calling write() fewer times.
2013-02-21 15:23:18 -08:00
isaacs 089ec58613 path: Throw TypeError on non-string args to path.resolve 2013-02-21 15:18:44 -08:00
Nathan Rajlich 50c88e0ff2 test: modify async native test.js to test for #4820 2013-02-21 13:14:07 -08:00
Nathan Rajlich 4b61522f16 test: add an "async-hello-world" native addon test 2013-02-21 13:14:07 -08:00
Arianit Uka 055110dab0 path: join throws TypeError on non-string args
lib/path.js:
  - throws a TypeError on the filter if the argument is not a string.

test/simple/test-path.js:
  - removed the test to check if non-string types are filtered.
  - added a test to check if path.join throws TypeError on arguments that
    are not strings.
2013-02-21 11:50:47 -08:00
Fedor Indutny ebc95f0716 tls: _handle.readStart/readStop for CryptoStream
lib/http.js is using stream._handle.readStart/readStop to control
data-flow coming out from underlying stream. If this methods are not
present - data might be buffered regardless of whether it'll be read.

see #4657
2013-02-21 23:29:18 +04:00
Trevor Norris 7301ba3969 process: fix bug where spinner wasn't called
Apperently there is a case where calling the spinner was required after
passing a callback to nextTick(). This fixes that issue.
2013-02-21 10:31:01 -08:00
isaacs bbcb8b3ae0 path: Do not coerce paths to strings on Windows
Fix #4795
2013-02-20 14:04:30 -08:00
Ben Noordhuis 9d10bf58a3 stream_wrap: remove superfluous buffer len check
It's a buffer so it's never bigger than Buffer::kMaxLength bytes,
which in turn is always < INT_MAX.
2013-02-20 22:17:36 +01:00
Ben Noordhuis 6ad792610b deps: upgrade libuv to 26fa6f8 2013-02-20 21:29:52 +01:00
Trevor Norris d69a26b965 buffer: check logic simplification
Checks have been simplified and optimized for most-used cases.

Calling Buffer with another Buffer as the subject will now use the
SlowBuffer Copy method instead of the for loop.

No need to call for value coercion, just place the ternary inline.
2013-02-20 20:34:34 +01:00
isaacs 053e02ef8e benchmark: Fix alignment issues on --html compare output 2013-02-20 09:17:29 -08:00
Ben Noordhuis 57ef65916b node: code cleanup, make tick_infobox static
It's not used outside of src/node.cc so make it static.
2013-02-20 14:15:11 +01:00
Ben Noordhuis 0dcbecd32b crypto: fix uninitialized memory access in openssl
ASN1_STRING_to_UTF8() passes an ASN1_STRING to ASN1_STRING_set() but forgot to
initialize the `length` field.

Fixes the following valgrind error:

  $ valgrind -q --track-origins=yes --num-callers=19 \
      out/Debug/node test/simple/test-tls-client-abort.js
  ==2690== Conditional jump or move depends on uninitialised value(s)
  ==2690==    at 0x784B69: ASN1_STRING_set (asn1_lib.c:382)
  ==2690==    by 0x809564: ASN1_mbstring_ncopy (a_mbstr.c:204)
  ==2690==    by 0x8090F0: ASN1_mbstring_copy (a_mbstr.c:86)
  ==2690==    by 0x782F1F: ASN1_STRING_to_UTF8 (a_strex.c:570)
  ==2690==    by 0x78F090: asn1_string_canon (x_name.c:409)
  ==2690==    by 0x78EF17: x509_name_canon (x_name.c:354)
  ==2690==    by 0x78EA7D: x509_name_ex_d2i (x_name.c:210)
  ==2690==    by 0x788058: ASN1_item_ex_d2i (tasn_dec.c:239)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x787C93: ASN1_item_d2i (tasn_dec.c:136)
  ==2690==    by 0x78F5E4: d2i_X509 (x_x509.c:141)
  ==2690==    by 0x7C9B91: PEM_ASN1_read_bio (pem_oth.c:81)
  ==2690==    by 0x7CA506: PEM_read_bio_X509 (pem_x509.c:67)
  ==2690==    by 0x703C9A: node::crypto::SecureContext::AddRootCerts(v8::Arguments const&) (node_crypto.cc:497)
  ==2690==  Uninitialised value was created by a stack allocation
  ==2690==    at 0x782E89: ASN1_STRING_to_UTF8 (a_strex.c:560)
2013-02-20 17:01:47 +04:00
Bert Belder da945a7376 openssl: make perlasm target pentium or newer for masm outputs
When perlasm generates MASM code it sets the assembler target to 468.
In this mode MASM refuses to assemble a couple of instructions. Bumping
the target to 686 solves this problem.
2013-02-20 17:00:29 +04:00
Bert Belder eb29c4b2e6 openssl: disable HT sidechannel attack mitigation
It used to be off before. It's extremely unlikely that such an attack
would be a viable attack against node. And it makes AES much slower.
2013-02-20 16:49:03 +04:00
Fedor Indutny f317f5aee9 openssl: update to 1.0.1e 2013-02-20 16:48:20 +04:00
isaacs f1780a6be6 Merge branch 'benchmark-refactor-2' 2013-02-19 17:17:29 -08:00
isaacs bd4d585b7a bench: Add bench-crypto 2013-02-19 17:16:55 -08:00
isaacs 4b80f217cd bench: Simplify duration arguments to benchmarks
For throughput benchmarks, run with just 5s durations rather than 1s and 3s.

For startup benchmark, run with just a single 1s duration, since it's very
consistent anyway.
2013-02-19 17:16:55 -08:00
isaacs 2ed56e5235 bench: Consistency in benchmark filenames 2013-02-19 17:16:55 -08:00
isaacs 1eb6a92984 bench: Only run http,net,fs,tls by default 2013-02-19 17:16:55 -08:00
isaacs 06fbcca6bb bench: Remove _bench_timer (no loner used) 2013-02-19 17:16:55 -08:00
isaacs ef08f0fbb1 bench: Use wrk for http benchmarking
Remove ab, since it's no longer used.
2013-02-19 17:16:29 -08:00
isaacs e850cbab1c tools: Add wrk for benchmarking http servers 2013-02-19 17:16:18 -08:00
isaacs 035aa6b4ce bench: Show % change rather than % difference 2013-02-19 14:14:39 -08:00
isaacs 087c437961 bench: Add --html to compare script 2013-02-19 14:14:38 -08:00
isaacs 7658f4c29c bench: Fail gracefully if function_call binding fails 2013-02-19 14:14:38 -08:00
isaacs 0e59efd079 make: Add benchmark make targets 2013-02-19 14:14:38 -08:00
isaacs 7d51745827 bench: Remove old run script 2013-02-19 14:14:37 -08:00
isaacs 0a406869df bench: Replace tls-fragmentation with tls/throughput 2013-02-19 14:14:37 -08:00
isaacs bafc51c0f9 bench: Move tls-connect into benchmark/tls
Also, make it work properly with current node.
2013-02-19 14:14:37 -08:00
isaacs 8c719f7c71 bench: Make io.c output easier to read 2013-02-19 14:14:37 -08:00
isaacs 8a3f52170e bench: Remove io.js
Better covered by the other benchmark/fs scripts.
2013-02-19 14:14:36 -08:00
isaacs 2a64edb025 bench: Add fs write stream throughput 2013-02-19 14:14:36 -08:00
isaacs 1fc6f99340 bench: Add read-stream throughput 2013-02-19 14:14:36 -08:00
isaacs 6d116be7cf bench: Move fs-readfile.js to fs/readfile.js 2013-02-19 14:14:35 -08:00
isaacs 844b33205c bench: Move v8_bench into misc 2013-02-19 14:14:35 -08:00
isaacs 2a2942bd7f bench: Move string_creation into misc 2013-02-19 14:14:35 -08:00
isaacs fef35fc4f1 bench: Remove settimeout (Covered by misc/timeout.js) 2013-02-19 14:14:35 -08:00
isaacs 3761be3d99 bench: Move timers to misc/timers 2013-02-19 14:14:34 -08:00
isaacs 7e5cd08061 bench: move next-tick to misc/next-tick-breadth 2013-02-19 14:14:34 -08:00
isaacs f7a4ccb409 bench: Move nexttick-2 to misc/next-tick-depth
x
2013-02-19 14:14:34 -08:00
isaacs 44be55fc4e bench: Move process_loop to misc/spawn-echo 2013-02-19 14:14:34 -08:00
isaacs 4e1bcdcab9 bench: Add function_call to bench-misc 2013-02-19 14:14:33 -08:00
isaacs e87ed91fac bench: Arrays 2013-02-19 14:14:33 -08:00
isaacs 3f67a48dd4 bench: Add buffers/dataview_set 2013-02-19 14:14:33 -08:00