Skip to content

Commit 17b8f95

Browse files
committed
removeChildApp
1 parent 12c4686 commit 17b8f95

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/App.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,18 @@ struct TemplatedApp {
576576
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
577577
}
578578

579+
BuilderPatternReturnType &&removeChildApp(BuilderPatternReturnType *app) {
580+
/* Remove this app from httpContextData list over child apps and reset round robin */
581+
auto &childApps = httpContext->getSocketContextData()->childApps;
582+
childApps.erase(
583+
std::remove(childApps.begin(), childApps.end(), (void *) app),
584+
childApps.end()
585+
);
586+
httpContext->getSocketContextData()->roundRobin = 0;
587+
588+
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
589+
}
590+
579591
BuilderPatternReturnType &&addChildApp(BuilderPatternReturnType *app) {
580592
/* Add this app to httpContextData list over child apps and set onPreOpen */
581593
httpContext->getSocketContextData()->childApps.push_back((void *) app);

0 commit comments

Comments
 (0)