Skip to content

Commit

Permalink
Merge pull request #1507 from cloudflare/milan/ws-compression-pref
Browse files Browse the repository at this point in the history
Add implementations for getPreferredExtensions
  • Loading branch information
MellowYarker authored Jan 31, 2024
2 parents 926db7f + 3bfe1b6 commit 57dd1e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ apple_support_dependencies()

http_archive(
name = "capnp-cpp",
integrity = "sha256-kVnOrg/h0eq37kBsFEHTUZax20JTR4/1eDy+kRY7wD8=",
strip_prefix = "capnproto-capnproto-bafc222/c++",
integrity = "sha256-eLxPfuuwuX9FTYCHgB8Q6tpBq/aVHzBbi8yie8WwpAo",
strip_prefix = "capnproto-capnproto-af4c99d/c++",
type = "tgz",
urls = ["https://github.com/capnproto/capnproto/tarball/bafc222f2e602f18d126322deba159e68fddb42e"],
urls = ["https://github.com/capnproto/capnproto/tarball/af4c99d89dea3e6e299c3ff953ee03326fce80d6"],
)

http_archive(
Expand Down
4 changes: 4 additions & 0 deletions src/workerd/io/worker-interface.c++
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ public:
return wrap<void>(other.pumpTo(getInner()));
}

kj::Maybe<kj::String> getPreferredExtensions(ExtensionsContext ctx) override {
return getInner().getPreferredExtensions(ctx);
};

uint64_t sentByteCount() override { return 0; }
uint64_t receivedByteCount() override { return 0; }

Expand Down
5 changes: 5 additions & 0 deletions src/workerd/util/abortable.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ class AbortableWebSocket final: public kj::WebSocket,
return impl.getInner().receivedByteCount();
}

kj::Maybe<kj::String> getPreferredExtensions(ExtensionsContext ctx) override {
return impl.getInner().getPreferredExtensions(ctx);
};


private:
AbortableImpl<kj::WebSocket> impl;
};
Expand Down

0 comments on commit 57dd1e9

Please sign in to comment.