# [PATCH] sapi apache2 uninitialized content-length value

- Thread: https://externals.io/message/5612
- Original archive: https://news-web.php.net/php.internals/5612
- Started by Doru Petrescu on 2003-11-20T11:13:15+00:00
- Messages: 4
- 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

---

## #5612 — Doru Petrescu — 2003-11-20T11:13:15+00:00

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

Hi,

   While playing with the upload progress meter I noticed that apache2
sapi implementation does not initialize the content-length sapi
variable. Apache 1.3 sapi does! and so does ALL OTHER interfaces. A
quick grep into the sources will reveal that only apache2handler and
apache2filter does not initialize this. Is there a reason for this ? Or
is just something that sliped ?

   I wrote a patch to fix this. see attached. tested and it works with
no problem and correctly reports the content-length.
   It is very simple and straight forward. copy/paste from apache 1.3
interface. now, I just wish nobody will upload anything over 2GB -
integer overflow will doom the upload.

   
   
-- 


Best regards,
Doru Petrescu
Senior Software Engineer
Astral Telecom Bucuresti

---

## #5617 — Ilia Alshanetsky — 2003-11-20T14:31:46+00:00

URL: https://externals.io/message/5612#5617 · In reply to: #5612

Why not simply do SG(request_info).content_length = 0; ?

Ilia

---

## #5618 — Uwe Schindler — 2003-11-20T15:17:01+00:00

URL: https://externals.io/message/5612#5618 · In reply to: #5617

all other sapi modules do it in the same way...

At 15:31 20.11.2003, Ilia Alshanetsky wrote:
>Why not simply do SG(request_info).content_length = 0; ?
>
>Ilia
>
>--
>
>

-----
Uwe Schindler
thetaphi@php.net - http://www.php.net
NSAPI SAPI developer
Erlangen, Germany

---

## #5619 — Doru Petrescu — 2003-11-20T15:21:27+00:00

URL: https://externals.io/message/5612#5619 · In reply to: #5617

you missed the point. it is probably zero like it is now, the point was
to put the right value there, not some garbage.

and of course I DO NEED THAT VALUE at some point in time, and I see no
use of having garbage or a wrong value there. also what stroke me is
that all other sapi modules were properly initializing this value ...


Doru Petrescu



> Why not simply do SG(request_info).content_length = 0; ?
> 
> Ilia
