Skip to content

Commit 4025a74

Browse files
committed
Stop moving out of KJ_IF_SOME
1 parent 85ad5ab commit 4025a74

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/workerd/api/http.c++

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ jsg::Ref<Request> Request::constructor(
10511051
// explicitly say `signal: null`, they must want to drop the signal that was on the
10521052
// original request.
10531053
signal = kj::mv(s);
1054+
initDict.signal = kj::none;
10541055
}
10551056

10561057
KJ_IF_SOME(newCf, initDict.cf) {

src/workerd/api/http.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,14 +787,14 @@ class Request final: public Body {
787787
// that the cancel machinery is not used but the request.signal accessor will still
788788
// do the right thing.
789789
if (s->getNeverAborts()) {
790-
this->thisSignal = kj::mv(s);
790+
this->thisSignal = s.addRef();
791791
} else {
792-
this->signal = kj::mv(s);
792+
this->signal = s.addRef();
793793
}
794794
}
795795

796796
KJ_IF_SOME(s, thisSignal) {
797-
this->thisSignal = kj::mv(s);
797+
this->thisSignal = s.addRef();
798798
}
799799
}
800800
// TODO(conform): Technically, the request's URL should be parsed immediately upon Request

src/workerd/io/worker-entrypoint.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ kj::Promise<void> WorkerEntrypoint::request(kj::HttpMethod method,
380380
// listener.
381381
KJ_IF_SOME(ctrl, abortController) {
382382
context.addWaitUntil(context.run(
383-
[ctrl = kj::mv(ctrl)](Worker::Lock& lock) mutable { ctrl->abort(lock, kj::none); }));
383+
[ctrl = ctrl.addRef()](Worker::Lock& lock) mutable { ctrl->abort(lock, kj::none); }));
384384
}
385385
}
386386

0 commit comments

Comments
 (0)