Issue #648 resolved

Flash 8 upload socket timeout

Robert Brewer
created an issue

Flash 8's !FileReference.upload(url) uses a corner-case of the multipart-MIME spec; its last part doesn't end in a trailing "\r\n" as most do. This causes cgi's read_lines_to_outerboundary to get stuck in a loop until the socket times out. See user reports [http://www.modpython.org/pipermail/mod_python/2006-April/020897.html here] and [http://groups.google.com/group/cherrypy-users/browse_frm/thread/1bc20bcb0637de7b here].

Although portions of [http://www.ietf.org/rfc/rfc2046.txt RFC 2046] seem to imply that the last CRLF is mandatory, the BNF for multipart-body clearly shows that a trailing CRLF is optional:

{{{ multipart-body := [preamble CRLF] dash-boundary transport-padding CRLF body-part *encapsulation close-delimiter transport-padding [CRLF epilogue] }}}

Comments (5)

  1. Anonymous

    Section 3.7.2 of RFC 2616 says:

    ''Unlike in RFC 2046, the epilogue of any multipart message MUST be empty; HTTP applications MUST NOT transmit the epilogue (even if the original multipart contains an epilogue)''

    I'm not sure how to interpret it though in our case.

  2. Log in to comment