1. Aug 27, 2013
    • Ben Noordhuis's avatar
      cares_wrap: drop UV_HANDLE_FIELDS from ares_task_t · 0523da64
      Ben Noordhuis authored
      UV_HANDLE_FIELDS is a libuv implementation detail.  The ares_task_t
      struct only uses the uv_loop_t* field so be explicit about that.
      0523da64
    • Ben Noordhuis's avatar
      src: fix up unused/unordered imports · 9fc00661
      Ben Noordhuis authored
      9fc00661
    • Trevor Norris's avatar
      buffer: fix assert fail from JS API · 873b5f84
      Trevor Norris authored
      Length arguments passed to SlowBuffer were coerced to Int32, not Uint32,
      so passing a negative number would throw the following:
      
      node: ../src/smalloc.cc:244: void node::smalloc::Alloc(): Assertion `length <= kMaxLength' failed.
      Aborted (core dumped)
      
      That has been fixed by coercing to Uint32 and comparing the value
      against kMaxLength.
      873b5f84
    • Trevor Norris's avatar
      buffer: add NativeBuffer API · 16a60ed2
      Trevor Norris authored
      Due to a lot of the util.is* checks there was much unnecessary overhead
      for the most common use case of Buffer. Which is creating a new Buffer
      instance for data from incoming I/O. NativeBuffer is a simple way to
      bypass all the unneeded checks and simply hand back a Buffer instance
      while setting the length.
      16a60ed2
  2. Aug 26, 2013
  3. Aug 25, 2013
  4. Aug 24, 2013
  5. Aug 23, 2013
  6. Aug 22, 2013
    • Trevor Norris's avatar
      buffer: fix inspect throw if slice length too long · fa89cf54
      Trevor Norris authored
      All the Buffer#{ascii,hex,etc.}Slice() methods are intentionally strict
      to alert if a Buffer instance was attempting to be accessed out of
      bounds. Buffer#toString() is the more user friendly way of accessing the
      data, and will coerce values to their min/max on overflow.
      fa89cf54
    • Timothy J Fontaine's avatar
      buffer: adhere to INSPECT_MAX_BYTES · 2769d97e
      Timothy J Fontaine authored
      2769d97e
    • isaacs's avatar
      vm: Put back display_errors flag · eef55277
      isaacs authored
      This is an important part of the repl use-case.
      
      TODO: The arg parsing in vm.runIn*Context() is rather wonky.
      It would be good to move more of that into the Script class,
      and/or an options object.
      eef55277
    • Domenic Denicola's avatar
      vm, core, module: re-do vm to fix known issues · 7afdba6e
      Domenic Denicola authored
      As documented in #3042 and in [1], the existing vm implementation has
      many problems. All of these are solved by @brianmcd's [contextify][2]
      package. This commit uses contextify as a conceptual base and its code
      core to overhaul the vm module and fix its many edge cases and caveats.
      
      Functionally, this fixes #3042. In particular:
      
      - A context is now indistinguishable from the object it is based on
        (the "sandbox"). A context is simply a sandbox that has been marked
        by the vm module, via `vm.createContext`, with special internal
        information that allows scripts to be run inside of it.
      - Consequently, items added to the context from anywhere are
        immediately visible to all code that can access that context, both
        inside and outside the virtual machine.
      
      This commit also smooths over the API very slightly:
      
      - Parameter defaults are now uniformly triggered via `undefined`, per
        ES6 semantics and previous discussion at [3].
      - Several undocumented and problematic features have been removed, e.g.
        the conflation of `vm.Script` with `vm` itself, and the fact that
        `Script` instances also had all static `vm` methods. The API is now
        exactly as documented (although arguably the existence of the
        `vm.Script` export is not yet documented, just the `Script` class
        itself).
      
      In terms of implementation, this replaces node_script.cc with
      node_contextify.cc, which is derived originally from [4] (see [5]) but
      has since undergone extensive modifications and iterations to expose
      the most useful C++ API and use the coding conventions and utilities of
      Node core.
      
      The bindings exposed by `process.binding('contextify')`
      (node_contextify.cc) replace those formerly exposed by
      `process.binding('evals')` (node_script.cc). They are:
      
      - ContextifyScript(code, [filename]), with methods:
        - runInThisContext()
        - runInContext(sandbox, [timeout])
      - makeContext(sandbox)
      
      From this, the vm.js file builds the entire documented vm module API.
      
      node.js and module.js were modified to use this new native binding, or
      the vm module itself where possible. This introduces an extra line or
      two into the stack traces of module compilation (and thus into most
      stack traces), explaining the changed tests.
      
      The tests were also updated slightly, with all vm-related simple tests
      consolidated as test/simple/test-vm-* (some of them were formerly
      test/simple/test-script-*). At the same time they switched from
      `common.debug` to `console.error` and were updated to use
      `assert.throws` instead of rolling their own error-testing methods.
      
      New tests were also added, of course, demonstrating the new
      capabilities and fixes.
      
      [1]: http://nodejs.org/docs/v0.10.16/api/vm.html#vm_caveats
      [2]: https://github.com/brianmcd/contextify
      [3]: https://github.com/joyent/node/issues/5323#issuecomment-20250726
      [4]: https://github.com/kkoopa/contextify/blob/bf123f3ef960f0943d1e30bda02e3163a004e964/src/contextify.cc
      [5]: https://gist.github.com/domenic/6068120
      7afdba6e
    • Timothy J Fontaine's avatar
      Now working on 0.11.7 · 3602d4c2
      Timothy J Fontaine authored
      3602d4c2
    • Timothy J Fontaine's avatar
      Merge branch 'v0.11.6-release' · 51336a44
      Timothy J Fontaine authored
      51336a44
    • Timothy J Fontaine's avatar
      2013.08.21, Version 0.11.6 (Unstable) · 04018d4b
      Timothy J Fontaine authored
      * uv: Upgrade to v0.11.8
      
      * v8: upgrade v8 to 3.20.14.1
      
      * build: disable SSLv2 by default (Ben Noordhuis)
      
      * build: don't auto-destroy existing configuration (Ben Noordhuis)
      
      * crypto: add TLS 1.1 and 1.2 to secureProtocol list (Matthias Bartelmeß)
      
      * crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)
      
      * dgram: don't call into js when send cb is omitted (Ben Noordhuis)
      
      * dgram: fix regression in string argument handling (Ben Noordhuis)
      
      * domains: performance improvements (Trevor Norris)
      
      * events: EventEmitter = require('events') (Jake Verbaten)
      
      * http: Add write()/end() callbacks (isaacs)
      
      * http: Consistent 'finish' event semantics (isaacs)
      
      * http: Prefer 'binary' over 'ascii' (isaacs)
      
      * http: Support legacy agent.addRequest API (isaacs)
      
      * http: Write hex/base64 chunks properly (isaacs)
      
      * http: add agent.maxFreeSockets option (isaacs)
      
      * http: provide access to raw headers/trailers (isaacs)
      
      * http: removed headers stay removed (James Halliday)
      
      * http,timers: improve callback performance (Ben Noordhuis)
      
      * net: family option in net.connect (Vsevolod Strukchinsky)
      
      * readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)
      
      * smalloc: allow different external array types (Trevor Norris)
      
      * smalloc: expose ExternalArraySize (Trevor Norris)
      
      * stream: Short-circuit buffer pushes when flowing (isaacs)
      
      * tls: handle errors on socket before releasing it (Fedor Indutny)
      
      * util: fix isPrimitive check (Trevor Norris)
      
      * util: isObject should always return boolean (Trevor Norris)
      04018d4b
    • Timothy J Fontaine's avatar
      uv: Upgrade to v0.11.8 · a784abaf
      Timothy J Fontaine authored
      a784abaf
    • Timothy J Fontaine's avatar
      41f55dc5
    • isaacs's avatar
      Merge remote-tracking branch 'ry/v0.10' · cdf2a661
      isaacs authored
      Conflicts:
      	lib/tls.js
      cdf2a661
  7. Aug 21, 2013
    • Fedor Indutny's avatar
      a1b3273a
    • Ben Noordhuis's avatar
      deps: upgrade http_parser to 303c4e4 · 8d42c634
      Ben Noordhuis authored
      Upgrade to joyent/http-parser@303c4e4. Changes:
      
        * Do not accept PUN/GEM methods as PUT/GET.
        * Further request method check strengthening.
      8d42c634
    • Fedor Indutny's avatar
      tls: fix assertion when ssl is destroyed at read · af6a2339
      Fedor Indutny authored
      `maybeInitFinished()` can emit the 'secure' event which
      in turn destroys the connection in case of authentication
      failure and sets `this.pair.ssl` to `null`.
      
      If such condition appeared after non-empty read - loop will continue
      and `clearOut` will be called on `null` object instead of
      `crypto::Connection` instance. Resulting in the following assertion:
      
          ERROR: Error: Hostname/IP doesn't match certificate's altnames
          Assertion failed: handle->InternalFieldCount() > 0
      
      fix #5756
      af6a2339
    • Trevor Norris's avatar
      smalloc: consistent-ify syntax · 849cf1aa
      Trevor Norris authored
      Small syntax fixes of variable renaming and argument alignment.
      849cf1aa
    • Trevor Norris's avatar
      smalloc: length is byte size, not array length · 6b5c43ed
      Trevor Norris authored
      The C++ API has been changed so the passed length is the byte size of
      the data, not the length of the array.
      
      This was done so users need to explicitly define how much memory they
      want allocated.
      6b5c43ed
    • Trevor Norris's avatar
      smalloc: expose ExternalArraySize · ed0677f4
      Trevor Norris authored
      Useful to correctly determine the byte size of the external memory that
      needs to be allocated for an external array.
      ed0677f4
    • Trevor Norris's avatar
      util: isObject should always return boolean · 50cee6ec
      Trevor Norris authored
      Fix small bug where isObject would return the original object instead of
      true.
      50cee6ec
    • Vsevolod Strukchinsky's avatar
      net: family option in net.connect · edd2fccc
      Vsevolod Strukchinsky authored
      `dns.lookup` defaults to selecting IPv4 record even if IPv6 is available
      for the desired zone. Generally, this approach works, but if IPv4
      address is unavailable - there'll be no other way to opt-out and connect using
      IPv6 address than calling `dns.lookup` and passing it to `.connect()`
      directly.
      
      This commit adds `family` option to `net.connect` method to figure out
      this issue.
      edd2fccc
  8. Aug 20, 2013
    • Gil Pedersen's avatar
      e04c8a8e
    • isaacs's avatar
      doc: Minor typos in dgram doc · 26a8c0c6
      isaacs authored
      a/an usage.  Thanks @KenanSulayman
      26a8c0c6
    • isaacs's avatar
      test: Remove unnecessary assertion · 85d6b783
      isaacs authored
      It only fails once in about 1000 times, but that's too many.
      It's timing dependent, and the main behavior is covered by the other
      assertions in the test anyway.
      85d6b783
    • Raynos's avatar
      events: have events module exports EventEmitter · 6ed861dd
      Raynos authored
      This change is 100% backwards compatible.
      
      This change will make using `EventEmitter` slightly simpler / nicer and
      adheres to the best practice set forth by substack.
      
      ```js
      var EventEmitter = require("events")
      
      var emitter = new EventEmitter()
      ```
      
      The only difference is that we now have to set `EventEmitter` as a
      property of `EventEmitter` for backwards compatibility like we do with
      [`Stream`][1]
      
      We have also set the `usingDomains` property on the `EventEmitter`
      constructor itself because that aligns with it's current usage of
      `require("events").usingDomains = true`
      
      There are other internals that would benefit from this change as well
      like `StringDecoder`
      6ed861dd
    • Matthew Aynalem's avatar
      fixes #6031 spelling errors · c171c490
      Matthew Aynalem authored
      explictly => explicitly
      accesss => access
      througput => throughput
      epxression => expression
      communiction => communication
      becuase => because
      repersent => represent
      condonitions => conditions
      decompresion => decompression
      intentially => intentionally
      eventes => events
      listning => listening
      resicved => received
      becuase => because
      fundimental => fundamental
      colapse => collapse
      privlages => privileges
      sufficently => sufficiently
      hapepns => happens
      expliclitly => explicitly
      thier => their
      shold => should
      c171c490
    • Duan Yao's avatar
      doc: Add callback parameter to dgram socket.bind() · 9456cf8f
      Duan Yao authored
      Also, describe more details of bind().
      9456cf8f
    • ChrisWren's avatar
      doc: fixed syntax error in stream.Transform · 2385fbbc
      ChrisWren authored
      2385fbbc
    • James Halliday's avatar
      http: removed headers stay removed · 5555318b
      James Halliday authored
      This allows automatically-inserted headers to be removed permanently by
      calling OutgoingMessage.removeHeader() on them, as if they were normal
      headers.
      5555318b