From: Carsten S. <ca...@gn...> - 2003-08-09 12:23:47
|
Hi! I have been looking at the code related to partial_post_size, because I wanted to make my CGI code make work with (which it doesn't at the moment). This would indeed be useful, as there is no reason to buffer the entire post data, which will be interpreted by the CGI script. I would like to have some issues resolved first, however. It seems that the current code assumes that partial posts will only happen for file uploads, ie multipart/form-data. The content type of a post and it being large should be considered independent properties. Also the interaction of the server code and the code implementing the dynamic file by repeatedly calling the dynamic code with different arguments seems quite un-Erlang-ish to me, if this is of any importance. Two other approaches come to my mind: * Have the dynamic code spawn a process that communicates with the server process similarly to the stream content handling. * Have the dynamic code return {get_more, Cont} where Cont is a real continuation, that is then called by the server code with the next chunk of data as the argument. Independently of this, an api function to wrap partial post unaware dynamic code would be beneficial, such that <erl> out(A) -> % code that does not know about partial posts, possibly calling % parse_post or using the raw A#arg.clidata </erl> could be easily replaced by <erl> out(A) -> yaws_api:call_with_entire_post_data(A, fun out_old/1). out_old(A) -> % code that does not know about partial posts, possibly calling % parse_post or using the raw A#arg.clidata </erl> One could also think of always calling out/1 with the entire post data, but calling out_partial if it exists. I fear that setting partial_post_size to a value different from nolimit might break a lot of existing code, especially if the value is small. Just think of large text fields. Greetings, Carsten --=20 Carsten Schultz (2:40, 33:47), FB Mathematik, FU Berlin http://carsten.fu-mathe-team.de/ PGP/GPG key on the pgp.net key servers,=20 fingerprint on my home page. |