rolkey / indyproject

Automatically exported from code.google.com/p/indyproject
0 stars 0 forks source link

Update TIdHTTP to handle MIME "multipart/..." response types #282

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Add a new flag to the TIdHTTP.HTTPOptions property to control how 
TIdHTTP.DoRequest() reads "multipart/..." data that would qualify for #4 in the 
RFC 2616 Section 4.4 rules:

1) When the flag is disabled (this would be the default so as not to break 
existing implementations), TIdHTTP.DoRequest() should recognize the terminating 
MIME boundary and read the raw MIME data as-is into the target TStream like any 
other response type.

2) When the new flag is enabled, TIdHTTP.DoRequest() should exit immediately 
after reading the HTTP headers.  The user's code would then be responsible for 
manually reading the MIME data from the connection.

Either solution would allow users to use existing TIdMessageCoderMIME-based 
solutions (or other MIME parsers) to process the MIME data as needed.

For #1, users would provide a suitable TStream object (TMemoryStream, etc) to 
receive the full MIME data before then parsing it.

For #2, users would provide TIdTCPStream to TIdMessageCoderMIME to receive MIME 
data from the existing HTTP connection in real-time.

I think this solution is a good compromise between existing workarounds, the 
need for TIdHTTP to finish supporting RFC 2616 Section 4.4, and a more proper 
way to handle "multipart/x-mixed-replace" server push events in particular 
(which are common used in webcams, for example).

Original issue reported on code.google.com by gambit47 on 5 Mar 2014 at 3:48

GoogleCodeExporter commented 8 years ago

Original comment by gambit47 on 5 Mar 2014 at 3:51

GoogleCodeExporter commented 8 years ago
a new hoNoReadMultipartMIME flag has been added to the TIdHTTP.HTTPOptions 
property.

Original comment by gambit47 on 15 Mar 2014 at 6:04