ID:               22772
 Updated by:       [EMAIL PROTECTED]
 Reported By:      c938264 at student dot dtu dot dk
-Status:           Open
+Status:           Feedback
 Bug Type:         Output Control
 Operating System: freeBSD 4.3, Apache/1.3.27
 PHP Version:      4.3.0
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2003-03-18 14:10:29] c938264 at student dot dtu dot dk

I found this problem trying to serve a binary file.
The basic structure of this part of my script is:

header('Content-Type: ..');
header('Content-Length: ..');
<output file contents>

where <output file contents> would be readfile or similar. However I
learned that the first byte of the served file was always a 0x0a
(linefeed). I have used telnet to create  requests and log responses,
and I have found that the response has the following structure:

<header><cr><lf>
..
<header><cr><lf>
<cr><lf>
<lf><body-part>

i.e. and extra <lf> prepended to the body part of the response. I have
tested several different scenarios:

* no headers, echo some text
* set chunked transfer encoding, do a readfile
* set chunked transfer encoding, echo some text
* set chunked transfer encoding, use fwrite on php://stdout

All methods prepend the linefeed. The telnet dump verify that the
headers are set correctly, so this should rule-out the possibility that
the linefeed stems from any text before the <? -tag.

PHP is build with the following configuration line:

'./configure' '--with-apache=../apache_1.3.27' '--enable-safe-mode'
'--with-mhash' '--enable-xslt' '--with-xslt-sablot'
'--enable-sablot-errors-descriptive' '--with-pdflib'
'--with-imap=/usr/local/imap' '--with-mcrypt' '--with-pspell'
'--with-gettext' '--with-mysql=/usr/local' '--with-pgsql' '--with-gd'
'--with-ttf' '--with-t1lib' '--with-png-dir'
'--with-zlib-dir=/usr/local/zlib' '--enable-memory-limit'
'--with-jpeg-dir' '--with-freetype-dir'
'--enable-freetype-4bit-antialias-hack' '--with-tiff-dir'
'--enable-exif' '--enable-calendar'

I think this problem may be related to #18740..

/David Holdt

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=22772&edit=1

Reply via email to