Commit bacf9744 authored by Kenton Varda's avatar Kenton Varda

Merge branch 'master' of https://github.com/capnproto/capnproto

parents bb8cbe74 ef130da3
......@@ -241,6 +241,11 @@ Own<DatagramPort> LowLevelAsyncIoProvider::wrapDatagramSocketFd(
Fd fd, LowLevelAsyncIoProvider::NetworkFilter& filter, uint flags) {
KJ_UNIMPLEMENTED("Datagram sockets not implemented.");
}
#if !_WIN32
Own<AsyncCapabilityStream> LowLevelAsyncIoProvider::wrapUnixSocketFd(Fd fd, uint flags) {
KJ_UNIMPLEMENTED("Unix socket with FD passing not implemented.");
}
#endif
CapabilityPipe AsyncIoProvider::newCapabilityPipe() {
KJ_UNIMPLEMENTED("Capability pipes not implemented.");
}
......
......@@ -574,9 +574,12 @@ public:
// `flags` is a bitwise-OR of the values of the `Flags` enum.
#if !_WIN32
virtual Own<AsyncCapabilityStream> wrapUnixSocketFd(Fd fd, uint flags = 0) = 0;
virtual Own<AsyncCapabilityStream> wrapUnixSocketFd(Fd fd, uint flags = 0);
// Like wrapSocketFd() but also support capability passing via SCM_RIGHTS. The socket must be
// a Unix domain socket.
//
// The default implementation throws UNIMPLEMENTED, for backwards-compatibility with
// LowLevelAsyncIoProvider implementations written before this method was added.
#endif
virtual Promise<Own<AsyncIoStream>> wrapConnectingSocketFd(
......
......@@ -2601,8 +2601,16 @@ KJ_TEST("HttpClient connection management") {
.wait(io.waitScope).body->readAllBytes().wait(io.waitScope);
KJ_EXPECT(count == 0);
#if !_WIN32 // TODO(soon): Figure out why this doesn't work on Windows. Probably a bug in
// Win32IocpEventPort::poll().
#if __linux__
// TODO(soon): Figure out why this doesn't work on Windows and is flakey on Mac. My guess is that
// the closing of the TCP connection propagates synchronously on Linux so that by the time we
// poll() the EventPort it reports the client end of the connection has reached EOF, whereas on
// Mac and Windows this propagation probably involves some concurrent process which may or may
// not complete before we poll(). A solution in this case would be to use a dummy in-memory
// ConnectionReceiver that returns in-memory pipes (see UnbufferedPipe earlier in this file),
// so that we don't rely on any non-local behavior. Another solution would be to pause for
// a short time, maybe.
// If the server times out the connection, we figure it out on the client.
doRequest().wait(io.waitScope);
KJ_EXPECT(count == 1);
......
......@@ -89,7 +89,8 @@ namespace kj {
MACRO(upgrade, "Upgrade") \
MACRO(websocketKey, "Sec-WebSocket-Key") \
MACRO(websocketVersion, "Sec-WebSocket-Version") \
MACRO(websocketAccept, "Sec-WebSocket-Accept")
MACRO(websocketAccept, "Sec-WebSocket-Accept") \
MACRO(websocketExtensions, "Sec-WebSocket-Extensions")
enum class HttpMethod {
// Enum of known HTTP methods.
......
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