Skip to content

Commit 5225b95

Browse files
jbeshaymeta-codesync[bot]
authored andcommitted
Fix session lifetime expectations in SessionWrapper sample code
Summary: By definition, draining the session in the SessionWrapper does not destroy the session. The session is expected to still be alive for a while and be destroyed later. The SessionWrapper should unset itself as the InfoCallback in the destructor. Reviewed By: hanidamlaj Differential Revision: D89944465 fbshipit-source-id: def3c151c292b3cc457373d477e2e15f982b71a2
1 parent b1c1b2e commit 5225b95

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

third-party/proxygen/src/proxygen/httpserver/samples/proxy/SessionWrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class SessionWrapper : public proxygen::HTTPSession::InfoCallback {
2323

2424
~SessionWrapper() override {
2525
if (session_) {
26+
session_->setInfoCallback(nullptr);
2627
session_->drain();
2728
}
2829
}

0 commit comments

Comments
 (0)