Fixed bug that coroutine won't destruct for keepalive request in swow server. (#3586)

This commit is contained in:
李铭昕 2021-05-14 12:44:23 +08:00 committed by GitHub
parent 373bf01d25
commit 8b13089b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# v2.1.17 - TBD
## Fixed
- [#3856](https://github.com/hyperf/hyperf/pull/3586) Fixed bug that coroutine won't destruct for keepalive request in swow server.
# v2.1.16 - 2021-04-26
## Fixed

View File

@ -127,7 +127,11 @@ class SwowServer implements ServerInterface
$handler->initCoreMiddleware($name);
}
if ($server instanceof HttpServer) {
$server->handle([$handler, $method]);
$server->handle(static function ($request, $session) use ($handler, $method) {
wait(static function () use ($request, $session, $handler, $method) {
$handler->{$method}($request, $session);
});
});
}
}
return;