source: trunk/server/common/patches/php-scripts-304.patch @ 1306

Last change on this file since 1306 was 1035, checked in by mitchb, 16 years ago
Fix "the-bug" (non-empty content in 304s) in PHP (patch by ezyang) and Apache PHP should not produce any output, even if zlib.output_compression is on, if the HTTP response code is 204 or 304 (no content or not modified). Fixes PHP bug #42362 with php.cvs #56693, see: http://bugs.php.net/bug.php?id=42362 http://news.php.net/php.cvs/56693 http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib.c?r1=1.183.2.6.2.5.2.9&r2=1.183.2.6.2.5.2.10 Apache should discard any body provided by a script (in any language, not just PHP) when the status is "no content" or "not modified". Addresses part of Apache bug #40953, see: https://issues.apache.org/bugzilla/show_bug.cgi?id=40953#c7 Solves scripts.mit.edu support issue #773060, see: https://help.mit.edu/Ticket/UpdateCallCenter.html?id=773060 https://diswww.mit.edu/charon/scripts/24018
File size: 451 bytes
  • php-5.2.8/ext/zlib/zlib.c

    old new  
    979979{
    980980        zend_bool do_start, do_end;
    981981
    982         if (!ZLIBG(output_compression)) {
     982        if (!ZLIBG(output_compression) || SG(sapi_headers).http_response_code == 204 || SG(sapi_headers).http_response_code == 304) {
    983983                *handled_output = NULL;
    984984        } else {
    985985                do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0);
Note: See TracBrowser for help on using the repository browser.