Merge branch 'master' into net2

This commit is contained in:
Ryan Dahl committed 2010-03-02 13:20:07 -08:00
commit 7881b59f6b
4 files changed
+22 -10

No files matched your search

+4 -1
View File
@@ -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
+5 -5
View File
@@ -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,14 +288,14 @@ 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;
return;
}
}
if (pullfd >= 0) {
/* select for readability on the pullfd */
r = select(pullfd+1, &readfds, NULL, &exceptfds, NULL);
+8 -2
View File
@@ -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.
*/
connection->stream_.errorno = req->result;
if (req->result) {
connection->stream_.errorno = req->result;
} else {
assert(r);
assert(connection->stream_.errorno);
}
connection->OnClose();
+5 -2
View File
@@ -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);
});