1. Mar 11, 2014
  2. Mar 07, 2014
    • Ben Noordhuis's avatar
      deps: fix v8 valgrind warning · 6bd78fd7
      Ben Noordhuis authored
      Fix the following valgrind warning:
      
          Conditional jump or move depends on uninitialised value(s)
              at 0x7D64E7: v8::internal::GlobalHandles::IterateAllRootsWithClassIds(v8::internal::ObjectVisitor*) (global-handles.cc:613)
              by 0x94DCDC: v8::internal::NativeObjectsExplorer::FillRetainedObjects() (profile-generator.cc:2849)
              # etc.
      
      This was fixed upstream in r12903 and released in 3.15.2 but that commit
      was never back-ported to the 3.14 branch that node.js v0.10 uses.
      
      The code itself works okay; this commit simply shuffles the clauses in
      an `if` statement to check that the node is in use before checking its
      class id (which is uninitialized if the node is not in use.)
      6bd78fd7
  3. Mar 06, 2014
    • Fedor Indutny's avatar
      child_process: fix sending handle twice · 5e06ce4f
      Fedor Indutny authored
      When sending a socket to a child process via IPC pipe,
      `child_process.js` picks a raw UV handle from `_handle` property, sends
      it, and assigns `null` to the property. Sending the same socket twice
      was resulting in a runtime error, since we weren't handling the empty
      `_handle` case.
      
      In case of `null` `_handle` we should send just a plain text message
      as passed it was passed to `.send()` and ignore the handle, letting
      users handle such cases themselves instead of throwing the error at
      runtime.
      
      fix #5469
      5e06ce4f
    • Benoit Vallée's avatar
      test: test sending a handle twice · a9d24fa4
      Benoit Vallée authored
      Added test-cluster-send-handle-twice.js testing to send a handle
      twice to the parent process.
      a9d24fa4
  4. Mar 05, 2014
    • Ben Noordhuis's avatar
      src: add default visibility to NODE_MODULE · bd8a5755
      Ben Noordhuis authored
      It's currently not really possible to compile native add-ons with
      -fvisibility=hidden because that also hides the struct containing
      the module definition.
      
      The NODE_MODULE() and NODE_MODULE_DECL() macros are structured in
      a way that makes it impossible to add a visibility attribute manually
      so there is no escape hatch there.
      
      That's why this commit adds an explicit visibility attribute to
      the module definition.  It doesn't help with node.js releases that
      are already out there but at least it improves the situation going
      forward.
      bd8a5755
  5. Mar 04, 2014
    • Brian White's avatar
      31ce3488
    • Brian White's avatar
      crypto: fix CipherFinal return value check · caca4f33
      Brian White authored
      caca4f33
    • Greg Brail's avatar
      timer: don't reschedule timer bucket in a domain · 6eb4d1d1
      Greg Brail authored
      If two timers run on the same tick, and the first timer uses a domain,
      and then catches an exception and disposes of the domain, then the
      second timer never runs. (And even if the first timer does not dispose
      of the domain, the second timer could run under the wrong domain.)
      
      This happens because timer.js uses "process.nextTick()" to schedule
      continued processing of the timers for that tick. However, there was
      an exception inside a domain, then "process.nextTick()" runs under
      the domain of the first timer function, and will do nothing if
      the domain has been disposed.
      
      To avoid this, we temporarily save the value of "process.domain"
      before calling nextTick so that it does not run inside any domain.
      6eb4d1d1
    • Timothy J Fontaine's avatar
      src: domain should not replace nextTick function · 06453a94
      Timothy J Fontaine authored
      Previously if you cached process.nextTick and then require('domain')
      subsequent nextTick() calls would not be caught because enqueued
      functions were taking the wrong path. This keeps nextTick to a single
      function reference and changes the implementation details after domain
      has been required.
      06453a94
  6. Mar 03, 2014
  7. Mar 02, 2014
  8. Feb 28, 2014
  9. Feb 27, 2014
    • Saúl Ibarra Corretgé's avatar
      src: spawn_sync should close handles upon exit · 269de79f
      Saúl Ibarra Corretgé authored
      When the exit callback is fired for the child process we should close
      the handle associated with it.
      269de79f
    • Timothy J Fontaine's avatar
      src: update to latest libuv api · afc29ed3
      Timothy J Fontaine authored
      libuv gyp builds now require you to define the library disposition
      (static or shared).
      
      Also, libuv now supports vectored IO for file system reads and writes,
      update to those function signatures
      afc29ed3
    • Timothy J Fontaine's avatar
      uv: Upgrade to v0.11.21 · cd08c8a0
      Timothy J Fontaine authored
      cd08c8a0
    • Nathan Rajlich's avatar
      http: remove the circular dependency · f3189ace
      Nathan Rajlich authored
      Between `ClientRequest` and `Agent`. The circular require was doing
      weird things at load time, like making the `globalAgent` property
      be `undefined` from within the context of the "_http_client"
      module.
      
      Removing the circular dependency completely fixes this.
      
      This commit effectively removes the undocumented `Agent#request()`
      and `Agent#get()` functions.
      f3189ace
    • Nathan Rajlich's avatar
      test: update "http-*" tests to only use public API · 0a5d8ca1
      Nathan Rajlich authored
      Don't invoke the `agent.requst()` or `agent.get()` functions
      directly. Instead, use the public API and pass the agent
      instance in as the `agent` option.
      0a5d8ca1
    • Nathan Rajlich's avatar
      http, https: don't depend on `globalAgent` · d6bbb19f
      Nathan Rajlich authored
      For the `request()` and `get()` functions. I could never
      really understand why these two functions go through agent
      first... Especially since the user could be passing `agent: false`
      or a different Agent instance completely, in which `globalAgent`
      will be completely bypassed.
      
      Moved the relevant logic from `Agent#request()` into the
      `ClientRequest` constructor.
      
      Incidentally, this commit fixes #7012 (which was the original
      intent of this commit).
      d6bbb19f
    • Nathan Rajlich's avatar
      test: add failing http `agent: null` test · d307bebe
      Nathan Rajlich authored
      See #7012.
      d307bebe
    • Nathan Rajlich's avatar
      test: add `agent: null` http client request test · 47abdd9c
      Nathan Rajlich authored
      This is just the test portion from #7012 / #7189,
      but targetted for the v0.10 branch.
      47abdd9c
    • Nathan Rajlich's avatar
      http: invoke createConnection when no agent · 0a01a42e
      Nathan Rajlich authored
      This makes it so that the user may pass in a
      `createConnection()` option, and they don't have
      to pass `agent: false` at the same time.
      
      Also adding a test for the `createConnection` option,
      since none was in place before.
      
      See #7014.
      0a01a42e
    • Trevor Norris's avatar
      test: fix async-listener-run-error-once · 846f304f
      Trevor Norris authored
      Rely on defined order of operations by closing the server and
      destorying the client socket, instead of when setImmediate fires
      846f304f
    • Alexis Campailla's avatar
      src: make stdout/sterr pipes blocking · 20176a98
      Alexis Campailla authored
      Expose `setBlocking` on Pipe's and if a pipe is being created for stdio
      on windows then make the pipes blocking.
      
      This fixes test-stream2-stderr-sync.js on Windows.
      
      Fixes #3584
      20176a98
    • Alexis Campailla's avatar
      test: remove invalid part of stream2-stderr-sync · c1bb8869
      Alexis Campailla authored
      One test case in test-stream2-stderr-sync.js was creating a TTY
      object using an undocumented constructor and passing in fd 2.
      However, this is running in a child process and fd 2 is actually
      a pipe, not a TTY.
      
      The constructor fails on Windows and causes the handle type to be
      left uninitialized, which later causes an assert to fail.
      
      On Unix, the constructor fails to retrieve the windows size but unlike
      on Windows, it just leaves the size fields undefined and continues
      with initializing the stream type, yielding a semi-usable object.
      
      I could make the Windows version match Unix behavior, but it
      seems to me that the test is relying on an implementation detail of
      an undocumented API, and the Unix behavior is not necessarily more
      correct than the Windows one. Thus it makes more sense to remove this
      test.
      c1bb8869
  10. Feb 26, 2014
    • Maxwell Krohn's avatar
      tls: stop NodeBIO::Gets from reading off end of buffer · a22a2d86
      Maxwell Krohn authored
      NodeBIO::Gets was reading off the end of a buffer if it
      didn't find a "\n" before the EOF.  This behavior
      was causing X509 certificates passed to `https.Agent`
      via the "ca" option to be silently discarded. It also
      was causing improper parsing of certs and keys
      passed to https.Agent, but those problems were worked
      around in cdde9a38.
      
      Backed out workaround in `lib/crypto.js` from ccde9a3,
      which now isn't needed.  But keep the test introduced
      in that commit, which tests properly for this
      bug.
      
      This bug was first introduced in a58f93f
      
      Gist containing test code, bisection log, and notes:
         https://gist.github.com/maxtaco/9211605
      a22a2d86
    • Alexis Campailla's avatar
      windows: fix module registration · b5f9779c
      Alexis Campailla authored
      The linker was optimizing the static variables that were supposed
      to trigger module initialization.
      
      I am making them non-static, and dllexport so that they don't get
      optimized away.
      
      Fixes #7116
      b5f9779c
    • Alexis Campailla's avatar
      net: fix listening on FDs on Windows · 2ca4d9d6
      Alexis Campailla authored
      Fix a bug introduced by 3da36fe0 of a missed early return of a handle
      that needed to be passed to listen.
      
      Fixes test-net-listen-fd0.js on Windows
      2ca4d9d6
    • Timothy J Fontaine's avatar
      test: internet/test-dns disable implicit ipv6 · 98a0909d
      Timothy J Fontaine authored
      This ends up being too difficult to test across different deployments
      98a0909d