amphp / http-server

An advanced async HTTP server library for PHP, perfect for real-time apps and APIs with high concurrency demands.
https://amphp.org/http-server
MIT License
1.29k stars 100 forks source link

Http1Driver::stop does not wait for requests #367

Open brstgt opened 5 months ago

brstgt commented 5 months ago

It's possible that HTTP 1 requests still arrive or are in progress after the HTTP server actually stopped.

It's because pendingResponse is being waited for in stop() but not set for HTTP1 requests without chunks + content length (like pretty much all GET requests).

Suggestion: http_server_shutdown.patch