Browse Source

Merge branch 'master' into net2

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
7881b59f6b
  1. 5
      Makefile
  2. 8
      deps/coupling/coupling.c
  3. 8
      src/node_net.cc
  4. 7
      test/pummel/test-tcp-pingpong.js

5
Makefile

@ -16,11 +16,14 @@ uninstall:
@$(WAF) uninstall
test: all
python tools/test.py --mode=release
python tools/test.py --mode=release simple
test-all: all
python tools/test.py --mode=debug,release
test-release: all
python tools/test.py --mode=release
test-debug: all
python tools/test.py --mode=debug

8
deps/coupling/coupling.c

@ -180,7 +180,7 @@ pull_pump (int pullfd, int pushfd)
/* eof */
close(pullfd);
pullfd = -1;
} else if (r < 0 && errno != EINTR && errno != EAGAIN) {
} else if (r < 0 && errno && errno != EINTR && errno != EAGAIN) {
/* error */
perror("pull_pump read()");
close(pullfd);
@ -192,7 +192,7 @@ pull_pump (int pullfd, int pushfd)
/* non-blocking write() to the pipe */
r = ring_buffer_push(&ring, pushfd);
if (r < 0 && errno != EAGAIN && errno != EINTR) {
if (r < 0 && errno && errno != EAGAIN && errno != EINTR) {
if (errno == EPIPE) {
/* This happens if someone closes the other end of the pipe. This
* is a normal forced close of STDIN. Hopefully there wasn't data
@ -274,7 +274,7 @@ push_pump (int pullfd, int pushfd)
/* eof */
close(pullfd);
pullfd = -1;
} else if (r < 0 && errno != EINTR && errno != EAGAIN) {
} else if (r < 0 && errno && errno != EINTR && errno != EAGAIN) {
perror("push_pump read()");
close(pullfd);
pullfd = -1;
@ -288,7 +288,7 @@ push_pump (int pullfd, int pushfd)
/* If there was a problem, just exit the entire function */
if (r < 0 && errno != EINTR) {
if (r < 0 && errno && errno != EINTR && errno != EAGAIN) {
close(pushfd);
close(pullfd);
pushfd = pullfd = -1;

8
src/node_net.cc

@ -337,7 +337,7 @@ int Connection::AfterResolve(eio_req *req) {
if (address_list) freeaddrinfo(address_list);
// no error. return.
if (req->result == 0) {
if (req->result == 0 && !r) {
evcom_stream_attach(EV_DEFAULT_UC_ &connection->stream_);
goto out;
}
@ -348,7 +348,13 @@ int Connection::AfterResolve(eio_req *req) {
* The fact that I'm modifying a read-only variable here should be
* good evidence of this.
*/
if (req->result) {
connection->stream_.errorno = req->result;
} else {
assert(r);
assert(connection->stream_.errorno);
}
connection->OnClose();

7
test/pummel/test-tcp-pingpong.js

@ -82,8 +82,11 @@ function pingPongTest (port, host, on_complete) {
/* All are run at once, so run on different ports */
pingPongTest(PORT, "localhost");
pingPongTest(PORT+1, null);
pingPongTest(PORT+2, "::1");
// This IPv6 isn't working on Solaris
var solaris = /sunos/i.test(process.platform);
if (!solaris) pingPongTest(PORT+2, "::1");
process.addListener("exit", function () {
assert.equal(3, tests_run);
assert.equal(solaris ? 2 : 3, tests_run);
});

Loading…
Cancel
Save