Ticket #808 (defect)
Opened 3 weeks ago
Last modified 3 weeks ago
Regression of Ticket #648 ( Flash 8 upload socket timeout )
Status: closed (worksforme)
| Reported by: | t.steinruecken@service4every1.de | Assigned to: | fumanchu |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | CherryPy code | Keywords: | |
| Cc: |
I get the following error when uploading a file using Adobe Air/(Flash) and CherryPy-3.1b1. Uploading using a standard webbrowser works.
[26/Apr/2008:23:33:10] HTTP
Request Headers:
ACCEPT: text/*
X-FORWARDED-SERVER: xxxxx
COOKIE: session_id=0bce6f5c42b2e896f92e6b50d86aa11957ef2bd5
Content-Type: multipart/form-data; boundary=----------ei4ei4ae0Ef1ei4cH2cH2ei4gL6Ef1
HOST: 127.0.0.1:8080
CACHE-CONTROL: no-cache
Content-Length: 200993
USER-AGENT: Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0
CONNECTION: Keep-Alive
Remote-Addr: 127.0.0.1
X-FORWARDED-HOST: xxxxx
X-FORWARDED-FOR: xxxxxx
[26/Apr/2008:23:33:10] HTTP Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/cherrypy/_cprequest.py", line 588, in respond
cherrypy.response.body = self.handler()
File "/usr/lib/python2.5/site-packages/cherrypy/_cpdispatch.py", line 24, in __call__
return self.callable(*self.args, **self.kwargs)
File "/root/oppriss-srv/apps.py", line 76, in upload
keep_blank_values=True)
File "/usr/lib/python2.5/cgi.py", line 534, in __init__
self.read_multi(environ, keep_blank_values, strict_parsing)
File "/usr/lib/python2.5/cgi.py", line 659, in read_multi
environ, keep_blank_values, strict_parsing)
File "/usr/lib/python2.5/cgi.py", line 536, in __init__
self.read_single()
File "/usr/lib/python2.5/cgi.py", line 669, in read_single
self.read_lines()
File "/usr/lib/python2.5/cgi.py", line 691, in read_lines
self.read_lines_to_outerboundary()
File "/usr/lib/python2.5/cgi.py", line 719, in read_lines_to_outerboundary
line = self.fp.readline(1<<16)
File "/usr/lib/python2.5/site-packages/cherrypy/wsgiserver/__init__.py", line 145, in readline
data = self.rfile.readline(size)
File "/usr/lib/python2.5/socket.py", line 373, in readline
data = self._sock.recv(self._rbufsize)
timeout: timed out
Change History
04/26/08 18:43:11: Modified by fumanchu
- status changed from new to assigned.
- description changed.
04/26/08 18:49:43: Modified by fumanchu
- status changed from assigned to closed.
- resolution set to worksforme.
From the traceback, it looks like you're doing your own reads from the request.rfile. Did you call cherrypy.lib.safemime.init()? As test_safemime shows, you need to call that and then turn on the tool:
from cherrypy.lib import safemime safemime.init() root._cp_config = {'tools.safe_multipart.on': True}


Reformatted.