From: php_query at mrdoms dot plus dot com Operating system: All PHP version: 4.3.2 PHP Bug Type: *General Issues Bug description: Session corrupts .jar file transmission
Description: ------------ I have a problem trying to redirect a request for a Java .jar through PHP. I am using PHP 4.3.2 on my Apache test server on Windows, and PHP 4.3.3 on my real Debian webserver. The problem is the same for both setups. If I access the .jar directly (no PHP) & use a packet sniffer, I get returned: <HTTP headers, Content-Type: text/html > CRLF CRLF // End of header? 190 CRLF // unknown value <.jar file> If I use a simple script with just a readfile, I get returned: <HTTP headers, Content-Type: text/html > CRLF CRLF // End of header? <.jar file> This request fails to load in any Java VM, which claims the jar is corrupt. The '190' has mysteriously disappeared. My real PHP script includes a session to make sure the user is accessing the jar from our web page only (script appended). This gives: <HTTP headers, Content-Type: text/html > CRLF CRLF // End of header? 2000 CRLF // value now changed! <.jar file> This request will work fine with: IE6 & Microsoft VM 1.1, and IE6, Netscape, Mozilla with Sun VM 1.4+. It does not load correctly if I use Opera (any VM), or Java 1.3 (any browswer). Changing session cache controls make no difference. The main issues are - What is the '190'? Why does the plain readfile() not send it? Why does the session turn it into '2000' which breaks some browswers? Thank you for your time, Dom Reproduce code: --------------- <?php // This fails always header("Content-Type: text/html; charset=ISO-8859-1"); readfile("tj.jar"); ?> <?php // This works always header("Content-Type: text/html; charset=ISO-8859-1"); header("\n\n190\n"); readfile("../_JAVARES/car/jammer.jar"); ?> <?php // This sometimes fails depending on browser/VM session_start(); header("Content-Type: text/html; charset=ISO-8859-1"); readfile("tj.jar"); ?> -- Edit bug report at http://bugs.php.net/?id=26203&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26203&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26203&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26203&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26203&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26203&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=26203&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26203&r=support Expected behavior: http://bugs.php.net/fix.php?id=26203&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26203&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26203&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26203&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26203&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26203&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26203&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26203&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26203&r=float