Edit report at https://bugs.php.net/bug.php?id=25175&edit=1
ID: 25175
Comment by: lildurk25175 at gmail dot com
Reported by: phpbug at paypc dot com
Summary: session.use_trans_sid causes ob_get_length() to
return incorrect value
Status: Not a bug
Type: Bug
Package: Session related
Operating System: Linux 2.4
PHP Version: 4.3.2
Block user comment: N
Private report: N
New Comment:
Lil Durk is a private agency dedicated to providing responsible access to legal cannabis for adults
aged 19 and older. Weâre an exclusively online retailer and wholesaler for recreational
cannabis and a trusted source for information about cannabis and cannabis-related issues. We believe
our work is meaningful and we take pride in our mandate to promote the socially responsible use of
legal cannabis. https://lildurk.com/
Previous Comments:
------------------------------------------------------------------------
[2003-08-25 16:19:49] moriyoshi@php.net
As the documentation says, ob_get_length() returns the length of the current output buffer.
It's not supposed to return the length of the actual HTTP content, while it's also the
case those values are often the same. I'm afraid, that you cannot do it right with the current
version of PHP.
One can say this is a design issue, but it's not an actual bug, although we can deem it as a
feature request. So it'd be better to file a new report for such a function that returns the
content length than turn this report into a request, which may cause confusion on other people using
this bug database.
Thanks.
------------------------------------------------------------------------
[2003-08-23 04:47:49] phpbug at paypc dot com
ARGH... I had just rebuilt PHP (from the snapshot) and Apache.... the problem still exists, though
Moriyoshi-san pretty much pre-confirmed it - I should have checked back here before embarking on a
web-server rebuild. No worries.
When I have trans_sid enabled, the discrepancy crops up again, but you knew that.
I have not plumbed the depths of Zend and the output buffering part of PHP, but I'm surprised
that this URL rewriting occurs at a level "higher" than that which obtaining the length of
that buffer to be sent can be determined.
I can understand the issues with the gzhandler readily enough - that's a "final pass"
process which takes the entire output and compresses it prior to its flight to the client.
If the gzhandler breaks trans_sid (or vice-versa), then I suspect someone make a bizarre design
decision about where these various parts need to fit together.
Transformation passes like trans_sid should be made before transport passes (like gzhandler) and
functions which determine buffer length get at things.
I would like to think that this is NOT a Bogus bug, but a bug whose fix is at least in the pipeline
to be addressed. While it's easier to understand how the gzhandler problems would be an
especially hard case to resolve, the ob_get_length() one shouldn't be.
Or is the problem one where the URL rewriting happens while the data is actually IN-FLIGHT to the
web-browser, after a possible response from the browser *AFTER* the header has been sent, but before
the content?
If the PHP team intends to never address this as a decision of policy, then retire this bug and
place warnings into the documentation and FAQ.
But if you intend to resolve it, I would think it retains some value to leave it as an open issue
for future (and possibly unspecified) future resolution.
Apollyon
------------------------------------------------------------------------
[2003-08-22 13:48:47] moriyoshi@php.net
Technically, this is not a bug. Please see the following description.
trans-sid (aka URL rewriter) utilises output buffering facility and it virtually works as a top
level output buffer handler in the hanlder stack. Thus ob_get_length() might not reflect the actual
length of the content being sent to the user-agent because trans-sid handler automatically rewrites
all URL referrers of the tags that are specified by url_rewriter.tags in your php.ini so they
contains session identifiers if the content includes any one of those tags. So, in any case
ob_get_length() returns the size of the intact content, on which no URL transformation is applied
yet. The same thing applies to zlib.output_compression.
Then let me mark this PR bogus since this is not a bug in PHP. But this behaviour is rather
confusing and will be addressed in the future versions.
BTW, how on earth did you know I'm Japanese? :)
------------------------------------------------------------------------
[2003-08-21 19:05:53] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-08-21 04:33:50] phpbug at paypc dot com
*ARGH* I hate "thinkoes" -- it should be obvious from context (and perusing my phpconfig)
that I've TURNED OFF enable_trans_sid, not turned it on.
Upon re-reading my posting (naturally AFTER I'd hit submit), I noted the think-o.
My apologies.
=Apollyon=
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=25175
--
Edit this bug report at https://bugs.php.net/bug.php?id=25175&edit=1