Permalink
Commits on Jul 4, 2012
Commits on Jul 3, 2012
  1. test: allow 80 ms intervals in hrtime test

    The hrtimer functionality on my FreeBSD 9 system is fairly coarse, it's usually
    just over the 60 ms that we tested for before this commit.
    bnoordhuis committed Jul 3, 2012
  2. unix: rename linux/core.c to linux/linux-core.c

    This is a back-port of commit e132075 from the master branch.
    
    Newer versions of gyp do not support files with the same basenames (example:
    core.c and linux/core.c).
    
    The nominal reason is consistency across build systems. Apparently, msbuild
    doesn't support it either.
    
    Somewhere, someplace, baby Jesus cries sad little tears...
    
    Fixes #464.
    bnoordhuis committed Jun 22, 2012
Commits on Jul 1, 2012
Commits on Jun 30, 2012
  1. unix: fix busy loop on unexpected tcp message

    Don't start reading immediately after connecting. If the server sends a message
    and the client hasn't called uv_read_start() yet, the event loop will busy loop
    because the pending message keeps waking it up.
    bnoordhuis committed Jun 30, 2012
  2. test: add 'unexpected read' tcp test

    Regression test that verifies that the event loop doesn't busy loop when
    the server sends a message and the client isn't reading.
    bnoordhuis committed Jun 30, 2012
Commits on Jun 29, 2012
  1. unix: fix EINPROGRESS busy loop

    Don't make the event loop spin when connect() returns EINPROGRESS.
    
    Test case:
    
      #include "uv.h"
    
      static void connect_cb(uv_connect_t* req, int status) {
        // ...
      }
    
      int main() {
        uv_tcp_t handle;
        uv_connect_t req;
        struct sockaddr_in addr;
        addr = uv_ip4_addr("8.8.8.8", 1234); // unreachable
        uv_tcp_init(uv_default_loop(), &handle);
        uv_tcp_connect(&req, (uv_stream_t*)&handle, addr, connect_cb);
        uv_run(uv_default_loop()); // busy loops until connection times out
        return 0;
      }
    
    After EINPROGRESS, there are zero active handles and one active request. That
    in turn makes uv__poll_timeout() believe that it should merely poll, not block,
    in epoll() / kqueue() / port_getn().
    
    Sidestep that by artificially starting the handle on connect() and stopping it
    again once the TCP handshake completes / is rejected / times out.
    
    It's a slightly hacky approach because I don't want to change the ABI of the
    stable branch. I'll address it properly in the master branch.
    bnoordhuis committed Jun 29, 2012
  2. unix: deduplicate socket creation code in tcp.c

    Incidentally fixes a rather obscure bug where uv_tcp_connect() reconnected
    and leaked a file descriptor when the handle was already busy connecting,
    handle->fd was zero (unlikely) and uv_tcp_connect() got called again.
    bnoordhuis committed Jun 29, 2012
  3. test: fix test-gethostbyname to not use a DNS server on localhost

    Because, you know, not everybody has one.
    piscisaureus committed Jun 29, 2012
  4. linux: don't use accept4() syscall after ENOSYS

    Repeatedly calling the syscall when it's not supported has a small but
    measurable performance impact.
    
    Besides, it's a silly thing to do.
    bnoordhuis committed Jun 29, 2012
  5. linux: fix accept4() ENOSYS detection on i386

    accept4() piggybacks on the socketcall() on i386. socketcall() has the flaw
    that it returns EINVAL instead of ENOSYS when the operation is not supported.
    
    The problem is that accept4() also returns EINVAL when its flag argument is
    invalid.
    
    Try to discern between the two failure cases to the best of our abilities.
    bnoordhuis committed Jun 29, 2012
Commits on Jun 28, 2012
  1. windows: don't inhibit reparse behavior when non-symlink is encountered

    This fixes the issue that a mount point would be treated as a
    symlink, but readlink would subsequently return an NT namespaced
    path that is unusable for many purposes.
    
    This also pre-emptively fixes the problems that would arise when
    an user has a reparse point whose tag is neither
    IO_REPARSE_TAG_MOUNT_POINT nor IO_REPARSE_TAG_SYMLINK.
    
    Finally uv_lstat() will now return the correct length in st_size.
    Previously the length was computed incorrectly for relative
    symlinks, and those that had non-ascii characters in their target.
    piscisaureus committed Jun 28, 2012
Commits on Jun 27, 2012
  1. unix: assume that dlopen() clobbers dlerror()

    Or rather, don't assume that dlopen() does *not* clobber dlerror().
    
    Joe Ferner reports that loading libjava on OS X sets dlerror() even when
    dlopen() succeeds, which makes uv_dlopen() raise an error when it shouldn't.
    
    I haven't been able to reproduce it but it's possible that libjava clobbers
    dlerror() by trying (and failing) to load other libraries.
    
    At any rate, Joe confirmed that this patch addresses the issue.
    
    Fixes #462.
    bnoordhuis committed Jun 27, 2012
Commits on Jun 26, 2012
  1. unix: don't create connect req when connect() fails

    Fixes a lifecycle issue where the req got created, added to the list of active
    reqs but wasn't properly activated because uv__connect() returned early.
    bnoordhuis committed Jun 26, 2012
  2. unix: map ENODEV to UV_ENODEV

    produces better error message from test-dgram-multicast-multi-process
    when run w/o network.
    
    before:
    
    === release test-dgram-multicast-multi-process ===
    Path: simple/test-dgram-multicast-multi-process
    dgram.js:287
        throw new errnoException(errno, 'addMembership');
              ^
    Error: addMembership Unknown system errno 19
        at new errnoException (dgram.js:356:11)
        at Socket.addMembership (dgram.js:287:11)
        at Object.<anonymous> (/home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js:224:16)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:487:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    [PARENT] Worker 9223 died. 1 dead of 3
    
    dgram.js:287
        throw new errnoException(errno, 'addMembership');
              ^
    Error: addMembership Unknown system errno 19
        at new errnoException (dgram.js:356:11)
        at Socket.addMembership (dgram.js:287:11)
        at Object.<anonymous> (/home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js:224:16)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:487:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    
    [PARENT] sent 'First message to send' to 224.0.0.114:12346
    dgram.js:287
    [PARENT] sent 'Second message to send' to 224.0.0.114:12346
        throw new errnoException(errno, 'addMembership');
    [PARENT] sent 'Third message to send' to 224.0.0.114:12346
              ^
    [PARENT] sendSocket closed
    [PARENT] Worker 9224 died. 2 dead of 3
    Error: addMembership Unknown system errno 19
        at new errnoException (dgram.js:356:11)
        at Socket.addMembership (dgram.js:287:11)
        at Object.<anonymous> (/home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js:224:16)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:487:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    [PARENT] Worker 9225 died. 3 dead of 3
    [PARENT] All workers have died.
    [PARENT] Fail
    Command: out/Release/node /home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js
    
    after:
    
    === release test-dgram-multicast-multi-process ===
    Path: simple/test-dgram-multicast-multi-process
    dgram.js:287
        throw new errnoException(errno, 'addMembership');
              ^
    Error: addMembership ENODEV
        at new errnoException (dgram.js:356:11)
        at Socket.addMembership (dgram.js:287:11)
        at Object.<anonymous> (/home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js:224:16)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:487:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    [PARENT] Worker 13141 died. 1 dead of 3
    
    dgram.js:287
        throw new errnoException(errno, 'addMembership');
              ^
    [PARENT] sent 'First message to send' to 224.0.0.114:12346
    [PARENT] sent 'Second message to send' to 224.0.0.114:12346
    [PARENT] sent 'Third message to send' to 224.0.0.114:12346
    [PARENT] sent 'Fourth message to send' to 224.0.0.114:12346
    [PARENT] sendSocket closed
    
    dgram.js:287
        throw new errnoException(errno, 'addMembership');
              ^
    Error: addMembership ENODEV
        at new errnoException (dgram.js:356:11)
        at Socket.addMembership (dgram.js:287:11)
        at Object.<anonymous> (/home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js:224:16)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:487:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    [PARENT] Worker 13142 died. 2 dead of 3
    Error: addMembership ENODEV
        at new errnoException (dgram.js:356:11)
        at Socket.addMembership (dgram.js:287:11)
        at Object.<anonymous> (/home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js:224:16)
        at Module._compile (module.js:449:26)
        at Object.Module._extensions..js (module.js:467:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Module.runMain (module.js:487:10)
        at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    [PARENT] Worker 13143 died. 3 dead of 3
    [PARENT] All workers have died.
    [PARENT] Fail
    Command: out/Release/node /home/roman/wc/node/test/simple/test-dgram-multicast-multi-process.js
    Roman Neuhauser committed with bnoordhuis Jun 25, 2012
Commits on Jun 25, 2012
Commits on Jun 22, 2012
  1. windows: whitespace fixes

    piscisaureus committed Jun 22, 2012
  2. Update libuv version macro.

    bnoordhuis committed Jun 22, 2012
Commits on Jun 21, 2012
  1. Make the stat benchmark run shorter

    Man, Windows is so slow...
    piscisaureus committed Jun 21, 2012
Commits on Jun 20, 2012
  1. unix, windows: stat: never pass NULL to cb

    Never pass NULL to the fs_poll callback, use a zeroed out statbuf instead.
    
    Makes the interface a little more convenient to use.
    bnoordhuis committed Jun 20, 2012
  2. windows: abort accept requests when a shared tcp server is closed

    Just closing the listening socket handle does not cancel AcceptEx
    operations when another handle is keeping the underlying socket
    open. Thus the AcceptEx operations have to be explicitly canceled
    in uv_tcp_close.
    piscisaureus committed Jun 20, 2012
Commits on Jun 19, 2012
Commits on Jun 18, 2012
  1. sunos: allow suppression of ifaddrs.h

    Older Solaris versions do not have this feature.  This allows
    them to set SUNOS_NO_IFADDRS to allow libuv to build.
    
    Re: nodejs/node-v0.x-archive#3465
    isaacs committed with bnoordhuis Jun 18, 2012