1. Aug 15, 2013
  2. Aug 13, 2013
  3. Aug 12, 2013
  4. Aug 11, 2013
    • Ben Noordhuis's avatar
      stream_wrap: use v8::Integer::NewFromUnsigned() · 2b5b37a3
      Ben Noordhuis authored
      Use v8::Integer::NewFromUnsigned() when updating the writeQueueSize
      field.
      
      Before this commit, it used v8::Integer::New() but that takes an
      int32_t. It's unlikely for a write queue to grow beyond 2**31-1 bytes
      but let's use the unsigned integer constructor anyway, just in case.
      2b5b37a3
  5. Aug 10, 2013
    • Ben Noordhuis's avatar
      v8: fix openbsd build · a20d565d
      Ben Noordhuis authored
      This is [1] applied ahead of time. Summary:
      
          OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h>
          and is a typedef for struct sigcontext. There is no uc_mcontext.
      
      [1] https://codereview.chromium.org/21705003/
      
      Note: the patch has been accepted upstream but hasn't made its way into
      a stable release yet.
      a20d565d
    • Ben Noordhuis's avatar
      v8: upgrade v8 to 3.20.14.1 · f69be329
      Ben Noordhuis authored
      f69be329
    • Ben Noordhuis's avatar
      build: disable SSLv2 by default · 39aa8940
      Ben Noordhuis authored
      No one in this day and age should be using SSLv2 so disable it by
      default. You can re-enable it with `./configure --with-sslv2` but
      there really should be no reason for that.
      39aa8940
    • Ben Noordhuis's avatar
      build: fix up style issues in configure script · c937f5b5
      Ben Noordhuis authored
      * Use single quotes consistently.
      * Remove a few stray semicolons.
      * Fix up some overly long lines.
      * Line up a few expressions.
      c937f5b5
    • Ben Noordhuis's avatar
      configure: order configure switches alphabetically · 52e47b24
      Ben Noordhuis authored
      Alphabetical order should make it easier to find the switches you need
      because we've got quite a lot of them now.
      
      Keep --prefix at the top because that's arguably the one people will be
      looking for most.
      52e47b24
    • Ben Noordhuis's avatar
      build: make ninja build respect V= · d046e9d0
      Ben Noordhuis authored
       Compiling with `make V=1` (which is the default) now runs ninja in
       verbose mode. To disable, run `make V=`.
      d046e9d0
    • Ben Noordhuis's avatar
      build: don't auto-destroy existing configuration · c75251ce
      Ben Noordhuis authored
      Don't run configure when the configure script has been touched. Doing so
      would be okay if the Makefile passed the original arguments to configure
      but it doesn't - it runs configure without any arguments, effectively
      destroying the current configuration.
      
      Remove this misfeature and instead print an error message telling the
      user to (re-)run configure.
      c75251ce
    • Trevor Norris's avatar
      domain: share object and state with native land · 3f5d5847
      Trevor Norris authored
      Change process.domain to use a getter/setter and access that property
      via an array index. These are much faster to get from c++, and it can be
      passed to _setupDomainUse and stored as a Persistent<Array>.
      
      InDomain() and GetDomain() as trivial ways to access the domain
      information in the native layer. Important because we'll be able to
      quickly access if a domain is active. Instead of just whether the domain
      module has been loaded.
      3f5d5847
    • Trevor Norris's avatar
      node: remove domain nextTick · 2ef1782b
      Trevor Norris authored
      It's ridiculously cheap to check if process.domain is set. Don't bother
      cluttering the code.
      2ef1782b
  6. Aug 09, 2013
  7. Aug 10, 2013
  8. Aug 09, 2013
    • Ben Noordhuis's avatar
      dgram: fix regression in string argument handling · 41ec6d05
      Ben Noordhuis authored
      v0.10 allows strings for the offset, length and port arguments to
      dgram.send() and dgram.sendto() but master before this commit would
      abort with the following assert:
      
          node: ../../src/udp_wrap.cc:227: static void
          node::UDPWrap::DoSend(const v8::FunctionCallbackInfo<v8::Value>&,
          int): Assertion `args[2]->IsUint32()' failed.
      
      Go beyond what v0.10 does and also add range checks: offset and length
      should be >= 0, port should be between 1 and 65535.
      
      That particular change needs to be back-ported to v0.10 because passing
      a negative offset or length number aborts with the following assertions:
      
          node: ../../src/udp_wrap.cc:264: static v8::Handle<v8::Value>
          node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
          `offset < Buffer::Length(buffer_obj)' failed.
      
      Or:
      
          node: ../../src/udp_wrap.cc:265: static v8::Handle<v8::Value>
          node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
          `length <= Buffer::Length(buffer_obj) - offset' failed.
      
      Interestingly enough, a negative port number is accepted in v0.10 but
      is silently ignored.
      
      This commit exposed a bug in the simple/test-dgram-close test which
      has also been fixed.
      41ec6d05
    • Ben Noordhuis's avatar
      src: use v8::String::NewFrom*() functions · f674b09f
      Ben Noordhuis authored
      * Change calls to String::New() and String::NewSymbol() to their
        respective one-byte, two-byte and UTF-8 counterparts.
      
      * Add a FIXED_ONE_BYTE_STRING macro that takes a string literal and
        turns it into a v8::Local<v8::String>.
      
      * Add helper functions that make v8::String::NewFromOneByte() easier to
        work with. Said function expects a `const uint8_t*` but almost every
        call site deals with `const char*` or `const unsigned char*`. Helps
        us avoid doing reinterpret_casts all over the place.
      
      * Code that handles file system paths keeps using UTF-8 for backwards
        compatibility reasons. At least now the use of UTF-8 is explicit.
      
      * Remove v8::String::NewSymbol() entirely. Almost all call sites were
        effectively minor de-optimizations. If you create a string only once,
        there is no point in making it a symbol. If you are create the same
        string repeatedly, it should probably be cached in a persistent
        handle.
      f674b09f
    • isaacs's avatar
      stream: Short-circuit buffer pushes when flowing · c0e70354
      isaacs authored
      When a stream is flowing, and not in the middle of a sync read, and
      the read buffer currently has a length of 0, we can just emit a 'data'
      event rather than push it onto the array, emit 'readable', and then
      automatically call read().
      
      As it happens, this is quite a frequent occurrence!  Making this change
      brings the HTTP benchmarks back into a good place after the removal of
      the .ondata/.onend socket kludge methods.
      c0e70354
    • isaacs's avatar
      http: Use streams3 directly, not .ondata/end · 967b5dbb
      isaacs authored
      967b5dbb
  9. Aug 08, 2013
    • Trevor Norris's avatar
      smalloc: allow different external array types · cec81593
      Trevor Norris authored
      smalloc.alloc now accepts an optional third argument which allows
      specifying the type of array that should be allocated. All available
      types are now located on smalloc.Types.
      cec81593
    • Trevor Norris's avatar
      smalloc: cleanup checks/conversions · cd000645
      Trevor Norris authored
      * Moved the ToObject check out of smalloc::Alloc and into JS. Direct
        usage of that method is for internal use only and so can bypass the
        possible coercion.
      * Same has been done with smalloc::SliceOnto.
      * smalloc::CopyOnto will now throw if passed argument is not an object.
      * Remove extra TargetFreeCallback function. There was a use for it when
        it was working with a Local<T>, but that code has been removed making
        the function superfluous.
      cd000645
    • Ben Noordhuis's avatar
      stream_wrap: fix long line introduced in da5ad92a · b9150344
      Ben Noordhuis authored
      Said commit was a back-port from a feature branch where it did lint.
      Mea culpa.
      b9150344
    • isaacs's avatar
      http: Support legacy agent.addRequest API · 12cd1331
      isaacs authored
      There are some agent subclasses using this today.
      
      Despite the addRequest function being undocumented internal API, it's
      easy enough to just support the old signature for backwards
      compatibility.
      12cd1331
    • Ben Noordhuis's avatar
      src: remove no-op HandleWrap::Initialize() · d24decb8
      Ben Noordhuis authored
      It's never been used and we probably never will. Remove it.
      d24decb8