timers: handle signed int32 overflow in enroll()
authorFedor Indutny <fedor.indutny@gmail.com>
Thu, 21 Mar 2013 17:38:30 +0000 (21:38 +0400)
committerFedor Indutny <fedor.indutny@gmail.com>
Thu, 21 Mar 2013 18:09:05 +0000 (22:09 +0400)
commitbfd16de125020551bf6fac42c01bc63d5fab90f5
treea7fee0c5b3f843191951b9bfc020f01fc402aa02
parent92cc1878812ca458462130a63d6f856854cf8cda
timers: handle signed int32 overflow in enroll()

Before this patch calling `socket.setTimeout(0xffffffff)` will result in
signed int32 overflow in C++ which resulted in assertion error:

    Assertion failed: (timeout >= -1), function uv__io_poll, file
    ../deps/uv/src/unix/kqueue.c, line 121.

see #5101
lib/timers.js
test/simple/test-http-timeout-overflow.js [new file with mode: 0644]