Commit 97687a67 authored by Kenton Varda's avatar Kenton Varda

Fix stuff.

parent fecb6086
...@@ -689,14 +689,15 @@ public: ...@@ -689,14 +689,15 @@ public:
case EINTR: case EINTR:
case ENETDOWN: case ENETDOWN:
case EPROTO: case EPROTO:
case ENOPROTOOPT:
case EHOSTDOWN: case EHOSTDOWN:
case ENONET:
case EHOSTUNREACH: case EHOSTUNREACH:
case EOPNOTSUPP:
case ENETUNREACH: case ENETUNREACH:
case ECONNABORTED: case ECONNABORTED:
// The incoming connection is dead-on-arrival. Just ignore it. case ETIMEDOUT:
// According to the Linux man page, accept() may report an error if the accepted
// connection is already broken. In this case, we really ought to just ignore it and
// keep waiting. But it's hard to say exactly what errors are such network errors and
// which ones are permanent errors. We've made a guess here.
goto retry; goto retry;
default: default:
...@@ -764,8 +765,11 @@ public: ...@@ -764,8 +765,11 @@ public:
} }
Own<ConnectionReceiver> listen() override { Own<ConnectionReceiver> listen() override {
KJ_ASSERT(addrs.size() == 1, if (addrs.size() > 1) {
"Sorry, unimplemented: Binding listen socket to multiple addresses."); KJ_LOG(WARNING, "Bind address resolved to multiple addresses. Only the first address will "
"be used. If this is incorrect, specify the address numerically. This may be fixed "
"in the future.", addrs[0].toString());
}
int fd = addrs[0].socket(SOCK_STREAM); int fd = addrs[0].socket(SOCK_STREAM);
......
...@@ -293,11 +293,9 @@ void UnixEventPort::poll() { ...@@ -293,11 +293,9 @@ void UnixEventPort::poll() {
threadCapture = &capture; threadCapture = &capture;
if (sigsetjmp(capture.jumpTo, true)) { if (sigsetjmp(capture.jumpTo, true)) {
// We received a signal and longjmp'd back out of the signal handler. // We received a signal and longjmp'd back out of the signal handler.
KJ_DBG("unsuspend", signalCount);
sigdelset(&waitMask, capture.siginfo.si_signo); sigdelset(&waitMask, capture.siginfo.si_signo);
gotSignal(capture.siginfo); gotSignal(capture.siginfo);
} else { } else {
KJ_DBG("suspend", signalCount);
sigsuspend(&waitMask); sigsuspend(&waitMask);
KJ_FAIL_ASSERT("sigsuspend() shouldn't return because the signal handler should " KJ_FAIL_ASSERT("sigsuspend() shouldn't return because the signal handler should "
"have siglongjmp()ed."); "have siglongjmp()ed.");
......
...@@ -529,9 +529,10 @@ class EventLoop { ...@@ -529,9 +529,10 @@ class EventLoop {
// EventLoop directly, but instead use `Promise`s to interact with it indirectly. See the // EventLoop directly, but instead use `Promise`s to interact with it indirectly. See the
// documentation for `Promise`. // documentation for `Promise`.
// //
// Each thread can have at most one EventLoop. When an EventLoop is created, it becomes the // Each thread can have at most one current EventLoop. To make an `EventLoop` current for
// default loop for the current thread. Async APIs require that the thread has a current // the thread, create a `WaitScope`. Async APIs require that the thread has a current EventLoop,
// EventLoop, or they will throw exceptions. // or they will throw exceptions. APIs that use `Promise::wait()` additionally must explicitly
// be passed a reference to the `WaitScope` to make the caller aware that they might block.
// //
// Generally, you will want to construct an `EventLoop` at the top level of your program, e.g. // Generally, you will want to construct an `EventLoop` at the top level of your program, e.g.
// in the main() function, or in the start function of a thread. You can then use it to // in the main() function, or in the start function of a thread. You can then use it to
......
linux-gcc-4.7 1758 ./super-test.sh tmpdir capnp-gcc-4.7 quick linux-gcc-4.7 1771 ./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 1761 ./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8 linux-gcc-4.8 1774 ./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 1781 ./super-test.sh tmpdir capnp-clang quick clang linux-clang 1794 ./super-test.sh tmpdir capnp-clang quick clang
mac 800 ./super-test.sh remote beat caffeinate quick mac 807 ./super-test.sh remote beat caffeinate quick
cygwin 805 ./super-test.sh remote Kenton@flashman quick cygwin 812 ./super-test.sh remote Kenton@flashman quick
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment