Skip to content

TrueAsync HTTP Server 0.18.0

Latest

Choose a tag to compare

@EdmondDantes EdmondDantes released this 29 Oct 17:53
· 15 commits to main since this release
6ddd46c

TrueAsync HTTP Server 0.18.0

Memory limits on PHP 8.6. Since PHP 8.6 an allocation past memory_limit no longer stops the script at once: it succeeds, the error is raised later, and one past twice the limit ends the process. A client sending a body larger than memory_limit could therefore grow the server's buffer until the worker process exited with every connection on it, and a handler that ran out of memory ended its whole worker. Now the body is refused (503, or a stream reset on HTTP/2 and HTTP/3) and a handler that runs out of memory answers its own request with 500, while the worker serves on. Cookies are new: HttpRequest::getCookies() and getCookie() decode the Cookie header as PHP fills $_COOKIE.

Behaviour a handler can notice.

  • getQueryParam('5') finds ?5=five, which getQuery() keys under the integer 5; it used to return null.
  • A form body that does not fit in memory_limit makes getPost() throw HttpException 503.
  • A pool worker's server object whose run has ended refuses start(), getConfig(), the add* methods and transfer to another thread.

Added

  • HttpRequest::getCookies() and getCookie($name, $default) (#434).

Fixed

  • A request body past memory_limit ended the worker process on PHP 8.6 (#437).
  • A handler past memory_limit ended the worker on PHP 8.6 instead of failing its own request (#437).
  • A pool worker whose start() failed with a fatal error kept the process from exiting on PHP 8.6 (#438).
  • getQueryParam() returned null for a numeric name (#433).

The full entries, with the evidence for each, are in CHANGELOG.md.