Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 236578 - filter output is corrupted
Summary: filter output is corrupted
Keywords:
Status: CLOSED DUPLICATE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mod_python
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-16 15:27 UTC by Martin Poole
Modified: 2007-11-17 01:14 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-16 15:43:57 UTC
Target Upstream Version:


Attachments (Terms of Use)
mod_python-3.1.3-buflen.patch buffer read fixes (deleted)
2007-04-16 15:27 UTC, Martin Poole
no flags Details | Diff

Description Martin Poole 2007-04-16 15:27:28 UTC
Description of problem:

---Problem Description---
On RHEL4U4 mod_python 3.1.3 is included. When passing large files through a
python script these files get corrupted. When building and installing mod_python
3.2.8 from EL5 the problem is fixed and the files are passed through correctly.
This URL http://issue s.apache.org/bugzilla/show_bug.cgi?id=41468 is about the
same issue but filed wrongly for httpd itself.


Contact Information = Tim Verhoeven/tim.verhoeven@be.ibm.com

---uname output---
Linux wegdaap40 2.6.9-42.EL #1 Wed Jul 12 23:15:20 EDT 2006 x86_64 x86_64 x86_64
GNU/Linux

Machine Type = VMWare ESX 3.0 guest

---Debugger---
A debugger is not configured

Version-Release number of selected component (if applicable):

mod_python-3.1.3-5.1

How reproducible:

always

Steps to Reproduce:

1. Install the following filter under DocumentRoot

import time
from mod_python import apache

def outputfilter(filter):


   # extract important info
   request = filter.req
   connection = request.connection
   (address,port) = connection.remote_addr

   # if requesting this file, don't return it
   if request.the_request.find("watcher.py") != -1:
       filter.close()
       return

   # pass-through filter
   s = filter.read()
   while s:
       filter.write(s)
       s = filter.read()
   if s is None:
       filter.close()

2. Add the following statements to the directory section containing the file in
the httpd config to enable python parsing :
           AddHandler mod_python .py
           PythonOutputFilter watcher WATCHER
           AddOutputFilter WATCHER ks.cfg
           AddOutputFilter WATCHER .rpm
           AddOutputFilter WATCHER .xml
           AddOutputFilter WATCHER .py

3. Put a small and large file ending in .rpm of .xml in the same dir and
retrieve the file using mozilla, wget, ...

  additional. The file only needs to be >8192 bytes

4. When using mod_python 3.1.3 the file is corrupted at the end with 3.2.8 not.
  
Actual results:

Corrupted file

Expected results:

clean file.

Additional info:

backported two lines of fix from the 3.2.8 version included with RHEL5, patch
attached.

Comment 1 Martin Poole 2007-04-16 15:27:35 UTC
Created attachment 152700 [details]
mod_python-3.1.3-buflen.patch buffer read fixes

Comment 2 Joe Orton 2007-04-16 15:43:57 UTC

*** This bug has been marked as a duplicate of 231065 ***


Note You need to log in before you can comment on or make changes to this bug.