@@ -82,9 +82,11 @@ void Container::signal(jsg::Lock& js, int signo) {
82
82
class Container ::TcpPortWorkerInterface final : public WorkerInterface {
83
83
public:
84
84
TcpPortWorkerInterface (capnp::ByteStreamFactory& byteStreamFactory,
85
+ kj::EntropySource& entropySource,
85
86
const kj::HttpHeaderTable& headerTable,
86
87
rpc::Container::Port::Client port)
87
88
: byteStreamFactory(byteStreamFactory),
89
+ entropySource (entropySource),
88
90
headerTable(headerTable),
89
91
port(kj::mv(port)) {}
90
92
@@ -120,7 +122,7 @@ class Container::TcpPortWorkerInterface final: public WorkerInterface {
120
122
connectImpl (*pipe.ends [1 ]).then ([]() -> kj::Promise<void > { return kj::NEVER_DONE; });
121
123
122
124
// ... and then stack an HttpClient on it ...
123
- auto client = kj::newHttpClient (headerTable, *pipe.ends [0 ]);
125
+ auto client = kj::newHttpClient (headerTable, *pipe.ends [0 ], {. entropySource = entropySource} );
124
126
125
127
// ... and then adapt that to an HttpService ...
126
128
auto service = kj::newHttpService (*client);
@@ -167,6 +169,7 @@ class Container::TcpPortWorkerInterface final: public WorkerInterface {
167
169
168
170
private:
169
171
capnp::ByteStreamFactory& byteStreamFactory;
172
+ kj::EntropySource& entropySource;
170
173
const kj::HttpHeaderTable& headerTable;
171
174
rpc::Container::Port::Client port;
172
175
@@ -209,19 +212,22 @@ class Container::TcpPortWorkerInterface final: public WorkerInterface {
209
212
class Container ::TcpPortOutgoingFactory final : public Fetcher::OutgoingFactory {
210
213
public:
211
214
TcpPortOutgoingFactory (capnp::ByteStreamFactory& byteStreamFactory,
215
+ kj::EntropySource& entropySource,
212
216
const kj::HttpHeaderTable& headerTable,
213
217
rpc::Container::Port::Client port)
214
218
: byteStreamFactory(byteStreamFactory),
219
+ entropySource (entropySource),
215
220
headerTable(headerTable),
216
221
port(kj::mv(port)) {}
217
222
218
223
kj::Own<WorkerInterface> newSingleUseClient (kj::Maybe<kj::String> cfStr) override {
219
224
// At present we have no use for `cfStr`.
220
- return kj::heap<TcpPortWorkerInterface>(byteStreamFactory, headerTable, port);
225
+ return kj::heap<TcpPortWorkerInterface>(byteStreamFactory, entropySource, headerTable, port);
221
226
}
222
227
223
228
private:
224
229
capnp::ByteStreamFactory& byteStreamFactory;
230
+ kj::EntropySource& entropySource;
225
231
const kj::HttpHeaderTable& headerTable;
226
232
rpc::Container::Port::Client port;
227
233
};
@@ -234,8 +240,9 @@ jsg::Ref<Fetcher> Container::getTcpPort(jsg::Lock& js, int port) {
234
240
235
241
auto & ioctx = IoContext::current ();
236
242
237
- kj::Own<Fetcher::OutgoingFactory> factory = kj::heap<TcpPortOutgoingFactory>(
238
- ioctx.getByteStreamFactory (), ioctx.getHeaderTable (), req.send ().getPort ());
243
+ kj::Own<Fetcher::OutgoingFactory> factory =
244
+ kj::heap<TcpPortOutgoingFactory>(ioctx.getByteStreamFactory (), ioctx.getEntropySource (),
245
+ ioctx.getHeaderTable (), req.send ().getPort ());
239
246
240
247
return jsg::alloc<Fetcher>(
241
248
ioctx.addObject (kj::mv (factory)), Fetcher::RequiresHostAndProtocol::YES, true );
0 commit comments