Message72917
See example code attached. A very basic http server responds with an XML
document to any GET request. I think what happens is that the connection
remains open at the end of the request, leading the browser to believe
there's more data to come (and hence not displaying anything).
What's curious is that commenting out the single line "self.dummy =
self" fixes the problem. Also, the problem occurs in 3.0b2 but not in 2.5.2.
To reproduce:
1. Run the example code on 3.0b2
2. Navigate to http://localhost:8123/
The browser shows "Transferring data" or something similar, until it
times out.
3. Comment out the line "self.dummy = self"
4. Navigate to http://localhost:8123/
This time it loads instantly.
Repeat with 2.5.2 - both variants work.
I don't know much at all about python internals, but it seems that 1) a
circular reference prevents the request handler from being GC'd and 2)
http.server relies on the request being GC'd to finalise the connection. |
|
Date |
User |
Action |
Args |
2008-09-09 21:21:12 | romkyns | set | recipients:
+ romkyns |
2008-09-09 21:21:12 | romkyns | set | messageid: <1220995272.13.0.856073925349.issue3826@psf.upfronthosting.co.za> |
2008-09-09 21:21:11 | romkyns | link | issue3826 messages |
2008-09-09 21:21:10 | romkyns | create | |
|