I run a BaseHTTPServer that way:
import CGIHTTPServer
import BaseHTTPServer
Handler = CGIHTTPServer.CGIHTTPRequestHandler
PORT = 8080
httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler)
print "Serving at port ", PORT
httpd.serve_forever()
on a linux, windows or OSX System, doasn't matter for
the problem
When i try to get a a big html-side (static html or cgi,
doasn't matter) with InternetExplorer 5.1 on OSX or OS9
the server hangs itself up.
I try to figure out the reason. It deppends on the size:
BaseHTTPServer (V. 06) do in line 43 :
self.copyfile(f, self.wfile)
copyfile is defined in line 146 and just do a
shutil.copyfileobj(source, outputfile)
copyfileobj in shutil is defined in line 14 and try to read
and write blocks of 16*1024 size.
I changed that and read 1024 byte blocks.
It worked 116 times. After that the IE seams to block.
(shutil (line 20) try to make the fdst.write(buf) but never
finished)
Other WebBrowsers (f.e. Apache) are able to support
bigger sides for the Mac IE 5.1. So it's (at least not only)
an IE problem and should be fixed in the Python Web
Server (IMHO).
Any ideas how to fix ?
I us Python 2.2 but I installed the newest versions of
BasHTTPServer, CGIHTTPServer, SimpleHTTPServer and
SocketServer.
|