# [PATCH] Apache 1.x sapi timeout name fix

- Thread: https://externals.io/message/39983
- Original archive: https://news-web.php.net/php.internals/39983
- Started by Lucas Nealan on 2008-08-16T02:36:01+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #39983 — Lucas Nealan — 2008-08-16T02:36:01+00:00

URL: https://externals.io/message/39983#39983

Hello,

Apache 1.x SAPI will occasionally timeout with a "Read POST information
timeout" error instead of a "send timeout" error as it should. This will
happen if the alarm timeout occurs in a POST request, at any point after the
post is read (ie. php_execute_script). This is because the
hard_timeout("send") name set within send_php() is overridden by the
hard_timeout("Read POST information") in sapi_apache_read_post() and never
restored. 

I walked through the startup calls from the point where timeout is set in
send_php to where the read post timeout is set. It seems highly unlikely
that a timeout should happen in this code, even if it were set to 1. The
patches below will correct the timeout name by moving the
hard_timeout("send") from send_php() to php_apache_sapi_activate(), which is
called just after the post is read.

http://sizzo.org/~screen/patches/php-5.3.0-timer_post.patch
http://sizzo.org/~screen/patches/php-HEAD-timer_post.patch

-lucas

---

## #40020 — johannes@php.net — 2008-08-20T17:47:24+00:00

URL: https://externals.io/message/39983#40020 · In reply to: #39983

Hi,

is anybody with deeper Apache knowledge around who can review that?

Thnaks,
johannes


> Hello,
> 
> Apache 1.x SAPI will occasionally timeout with a "Read POST information
> timeout" error instead of a "send timeout" error as it should. This will
> happen if the alarm timeout occurs in a POST request, at any point after the
> post is read (ie. php_execute_script). This is because the
> hard_timeout("send") name set within send_php() is overridden by the
> hard_timeout("Read POST information") in sapi_apache_read_post() and never
> restored. 
> 
> I walked through the startup calls from the point where timeout is set in
> send_php to where the read post timeout is set. It seems highly unlikely
> that a timeout should happen in this code, even if it were set to 1. The
> patches below will correct the timeout name by moving the
> hard_timeout("send") from send_php() to php_apache_sapi_activate(), which is
> called just after the post is read.
> 
> http://sizzo.org/~screen/patches/php-5.3.0-timer_post.patch
> http://sizzo.org/~screen/patches/php-HEAD-timer_post.patch
> 
> -lucas
