2008/8/22 Simon J. Oliver <[EMAIL PROTECTED]>:
> Thanks Graham!
>
> To save you the bother, I'm attaching said text file. This is the one
> with it aligned, so it breaks the download.
Very odd. I have no problem with your file, but can trigger problems
in other ways. Just the following is sufficient:
def application(environ, start_response):
status = '200 OK'
response_headers = [('Content-Type', 'text/plain'),]
start_response(status, response_headers)
path = os.path.join('/tmp/null.txt')
fd = open(path, 'w')
#fd.write(8192*'\0')
fd.write('\0')
fd.seek(0)
return environ['wsgi.file_wrapper'](fd)
Doing HEAD using telnet get:
$ telnet localhost 8224Trying ::1...
Connected to localhost.
Escape character is '^]'.
HEAD /wsgi/scripts/file.py HTTP/1.0
HTTP/1.1 200 OK
Date: Fri, 22 Aug 2008 00:57:38 GMT
Server: Apache/2.2.4 (Unix) mod_wsgi/3.0-TRUNK Python/2.3.5
Content-Length: 1
Connection: close
Content-Type: text/plain
Connection closed by foreign host.
If use curl it just hangs waiting for data.
Don't even need 4k of data. The first character of any 4k block,
including the first, being a null is possibly enough.
I'll have to check the code path which is used, but the whole point of
wsgi.file_wrapper is that it passes control for sending file off to
Apache functions to do. So first impression would be that I can't see
how this can be an issue in mod_wsgi and that it would have to be in
Apache.
Anyway, time for some digging.
Graham
> Cheers,
>
> Simon
>
> --
>
> Simon J. Oliver
> CISSP-ISSAP, ISSMP
> Applied Information Technology Center
> University of Memphis
>
>
> >
>
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!
>
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
> The quick brown fox jumped over the lazy dog!12345The quick brown fox jumped
> over the lazy dog!1234
>
>
>
>
>
>
>
> On Aug 21, 2008, at 7:33 PM, Graham Dumpleton wrote:
>
>>
>> Thanks for the detailed information.
>>
>> I was offline yesterday, so just catching up on emails etc. With this
>> I should be able to duplicate it with just wsgi.file_wrapper and not
>> even require Trac. I'll get on to this one today.
>>
>> Thanks again.
>>
>> Graham
>>
>> 2008/8/22 illuminarti <[EMAIL PROTECTED]>:
>>>
>>> OK, I can reproduce this from scratch. If I have a pure text file, 8k
>>> long (it just says 'The quick brown fox jumped over the lazy dog!'
>>> over and over again.)
>>> And roughly in the middle I put a single 0x00 character.
>>>
>>> If the null character is not exactly on the 4k boundary, I can
>>> download it from Trac with no problems.
>>>
>>> If I take out a few characters to align the null as the first byte of
>>> the second 4k of the file, the attempt to download the file stalls
>>> and
>>> eventually times out after exactly 4k has been downloaded.
>>>
>>> In both cases it uploads just fine as an attachment to a ticket, and
>>> can be displayed inline (since it's a text file, Trac is happy to
>>> display it - the problem happens when I click on the 'Download in
>>> original format' link).
>>>
>>> Wow. That's a doozy, isn't it? I have no idea why it happens, but at
>>> least we know what triggers it. But since it's a real pain to try and
>>> make sure the screenshots I'm uploading for the training materials
>>> I'm
>>> writing don't have a zero byte every 4k characters, I really hope we
>>> can find a solution :-)
>>>
>>>
>>>
>>> On Aug 21, 5:45 pm, illuminarti <[EMAIL PROTECTED]> wrote:
>>>> Some more information - in every one of my three problematic files,
>>>> the download cuts out on a 4kB boundary (44k in one case, 20k in the
>>>> second, and 4k in the third). And in every case, the next character
>>>> that should be transmitted is 0x00.
>>>>
>>>> Seems more than a coincidence... :-)
>>>>
>>>
>>
>> --~--~---------~--~----~------------~-------~--~----~
>> This message is part of the topic "Strange connection drops from Trac
>> via mod_wsgi" in the Google Group "modwsgi" for which you requested
>> email
>> updates.
>> To stop receiving email updates for this topic, please visit the topic
>> at http://groups.google.com/group/modwsgi/t/90d169459a651120
>> -~----------~----~----~----~------~----~------~--~---
>>
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---