mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Fixed context won't be destroyed when accept keepalive connection for co server. (#2227)
This commit is contained in:
parent
bbaffc409c
commit
dd1ff1164a
@ -9,6 +9,7 @@
|
||||
- [#2210](https://github.com/hyperf/hyperf/pull/2210) Fixed bug that open event won't be executed after handshake right now.
|
||||
- [#2214](https://github.com/hyperf/hyperf/pull/2214) Fixed bug that close event won't be executed when close the connection by websocket server.
|
||||
- [#2218](https://github.com/hyperf/hyperf/pull/2218) Fixed bug that sender does not works for coroutine server.
|
||||
- [#2227](https://github.com/hyperf/hyperf/pull/2227) Fixed context won't be destroyed when accept keepalive connection for co server.
|
||||
|
||||
## Optimized
|
||||
|
||||
|
@ -145,7 +145,11 @@ class CoroutineServer implements ServerInterface
|
||||
$handler->initCoreMiddleware($name);
|
||||
}
|
||||
if ($this->server instanceof \Swoole\Coroutine\Http\Server) {
|
||||
$this->server->handle('/', [$handler, $method]);
|
||||
$this->server->handle('/', static function ($request, $response) use ($handler, $method) {
|
||||
Coroutine::create(static function () use ($request, $response, $handler, $method) {
|
||||
$handler->{$method}($request, $response);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user