net: allow port 0 in connect()
authorcjihrig <cjihrig@gmail.com>
Mon, 23 Feb 2015 16:23:53 +0000 (11:23 -0500)
committercjihrig <cjihrig@gmail.com>
Thu, 5 Mar 2015 15:01:15 +0000 (10:01 -0500)
commit9d2b89d06c14f8e250e290668507c9daa8ec97ca
tree81845bb4fcbb4c1d14dd61c6cbfd0465ba2c1ebb
parent31421afe897635bd86201c2e677fb881b57a892c
net: allow port 0 in connect()

The added validation allows non-negative numbers and numeric
strings. All other values result in a thrown exception.

Fixes: https://github.com/joyent/node/issues/9194
PR-URL: https://github.com/joyent/node/pull/9268
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@users.noreply.github.com>
lib/net.js
src/tcp_wrap.cc
test/parallel/test-net-create-connection.js
test/parallel/test-net-localerror.js