1. Aug 01, 2013
    • Ben Noordhuis's avatar
      test: fix pummel/test-net-connect-memleak · 98db7bab
      Ben Noordhuis authored
      * Run the garbage collector before creating the big array. It doesn't
        matter now but if in the future something in node.js core creates
        a lot of reclaimable garbage, that will break the test's expectation.
      
      * The first RSS check was being done too late. The garbage collector
        might have run before the check, throwing off the 'reclaimed memory'
        calculation.
      
      * Due to changes in how V8 represents the big array internally, the
        actual memory usage is just below 256 MB on x64. Update the test's
        expectation.
      98db7bab
    • Ben Noordhuis's avatar
      events: fix memory leak, don't leak event names · fc6f8a69
      Ben Noordhuis authored
      Before this commit, events were set to undefined rather than deleted
      from the EventEmitter's backing dictionary for performance reasons:
      `delete obj.key` causes a transition of the dictionary's hidden class
      and that can be costly.
      
      Unfortunately, that introduces a memory leak when many events are added
      and then removed again. The strings containing the event names are never
      reclaimed by the garbage collector because they remain part of the
      dictionary.
      
      That's why this commit makes EventEmitter delete events again. This
      effectively reverts commit 0397223a.
      
      Fixes #5970.
      fc6f8a69
  2. Jul 31, 2013
    • Ben Noordhuis's avatar
      http: improve chunked res.write(buf) performance · 3398cce1
      Ben Noordhuis authored
      Avoid a costly buffer-to-string operation. Instead, allocate a new
      buffer, copy the chunk header and data into it and send that.
      
      The speed difference is negligible on small payloads but it really
      shines with larger (10+ kB) chunks. benchmark/http/end-vs-write-end
      with 64 kB chunks gives 45-50% higher throughput. With 1 MB chunks,
      the difference is a staggering 590%.
      
      Of course, YMMV will vary with real workloads and networks but this
      commit should have a positive impact on CPU and memory consumption.
      
      Big kudos to Wyatt Preul (@wpreul) for reporting the issue and providing
      the initial patch.
      
      Fixes #5941 and #5944.
      3398cce1
    • Wyatt Preul's avatar
      docs: Warning about consuming response · 6359e017
      Wyatt Preul authored
      6359e017
  3. Jul 30, 2013
    • Ben Noordhuis's avatar
      crypto: fix assert() on malformed hex input · 6327d67b
      Ben Noordhuis authored
      Use the StringBytes::IsValidString() function introduced in commit
      dce26cce to ensure that the input string meets the expectations of the
      other StringBytes functions before processing it further.
      
      Fixes the following assertion:
      
          Assertion failed: (str->Length() % 2 == 0 && "invalid hex string
          length"), function StorageSize, file ../../src/string_bytes.cc,
          line 301.
      
      Fixes #5725.
      6327d67b
    • Ben Noordhuis's avatar
      string_bytes: add StringBytes::IsValidString() · dce26cce
      Ben Noordhuis authored
      Performs a quick, non-exhaustive check on the input string to see if
      it's compatible with the specified string encoding.
      
      Curently it only checks that hex strings have a length that is a
      multiple of two.
      dce26cce
  4. Jul 28, 2013
  5. Jul 27, 2013
  6. Jul 25, 2013
    • Ben Noordhuis's avatar
      test: fix simple/test-setproctitle · e4363145
      Ben Noordhuis authored
      The title shouldn't be too long; libuv's uv_set_process_title() out of
      security considerations no longer overwrites envp, only argv, so the
      maximum title length is possibly quite short.
      
      Fixes #5908.
      e4363145
  7. Jul 26, 2013
  8. Jul 25, 2013
  9. Jul 23, 2013
    • Ben Noordhuis's avatar
      src: os: use Number::New() for CPU info · e20811a6
      Ben Noordhuis authored
      The return values from uv_cpu_info() don't necessarily fit in a 32 bits
      signed integer.
      
      Fixes #5732.
      e20811a6
    • Ben Noordhuis's avatar
      fs: uids and gids must be unsigned ints · ed806385
      Ben Noordhuis authored
      Before this commit, fs.chown() and fs.fchown() coerced the uid and gid
      arguments to signed integers which is wrong because uid_t and gid_t are
      unsigned on most all platforms and IDs that don't fit in a signed
      integer do exist.
      
      This commit changes the aforementioned functions to take unsigned ints
      instead.  No test because we can't assume the system has [GU]IDs that
      large.
      
      This change depends on joyent/libuv@d779eb5.
      
      Fixes #5890.
      ed806385
  10. Jul 20, 2013
  11. Jul 19, 2013
  12. Jul 18, 2013
    • Shuan Wang's avatar
      url: Fix edge-case when protocol is non-lowercase · 48a4600c
      Shuan Wang authored
      When using url.parse(), path and pathname usually return '/' when there
      is no path available. However when you have a protocol that contains
      non-lowercase letters and the input string does not have a trailing
      slash, both path and pathname will be undefined.
      48a4600c
  13. Jul 17, 2013
    • isaacs's avatar
      doc: style the 'type' fields in API docs · 04e0324f
      isaacs authored
      04e0324f
    • isaacs's avatar
      doc: Streams API Doc Rewrite · db5776cf
      isaacs authored
      The Streams API doc is now broken up into 3 sections:
      
      1. API for Consumers
      2. API for Implementors
      3. Details and Extras
      
      This addresses one of the biggest points of confusion for new users who
      start to consume streams, and get the impression that they have to do
      lots of extra work and implement classes and such, just to get some data
      out of a file.
      db5776cf
  14. Jul 15, 2013
  15. Jul 13, 2013
  16. Jul 12, 2013
  17. Jul 11, 2013
    • Trevor Norris's avatar
      node: call MakeDomainCallback in all domain cases · 6d91bd37
      Trevor Norris authored
      Previously there was no way to pass a Function callback directly to
      MakeCallback and support domains. The check has been added so that users
      never have to worry about supporting domains while using MakeCallback.
      6d91bd37
  18. Jul 10, 2013