parameter called partial_post_size which if set to an integer value
will cause the content of the post content to be sent to the out/1
function in chunks of this size.
Changed implementation of multipart form data. There is a new config
parameter called partial_post_size which if set to an integer value
will cause the content of the post content to be sent to the out/1
function in chunks of this size.
It is possible to get the server to maintain a state on behalf of the out/1
user by returning {get_more, Cont, State}.
yaws_api:parse_post_data/1 will return either:
{cont, Cont, Res} where Res
is new result(s) from this segment. This indicates that there is more data to come
and the out/1 function should return {get_more, Cont, User_state} where User_state
might usefully be a File Descriptor.
Changed implementation of multipart form data. There is a new config
parameter called partial_post_size which if set to an integer value
will cause the content of the post content to be sent to the out/1
function in chunks of this size.
It is possible to get the server to maintain a state on behalf of the out/1
user by returning {get_more, Cont, State}.
yaws_api:parse_post_data/1 will now return either:
{cont, Cont, Res} where Res
is new result(s) from this segment. This indicates that there is more data to come
and the out/1 function should return {get_more, Cont, User_state} where User_state
might usefully be a File Descriptor.
or {result, Res} if this is the last (or only) segment.
Res is a list of {header, Header} | {part_body, Binary} | {body, Binary}
Example usage could be:
<erl>
out(A) ->
case yaws_api:parse_post_data(A) of
{cont, Cont, Res} ->
St = handle_res(A, Res),
{get_more, Cont, St};
{result, Res} ->
handle_res(A, Res),
{html, f("<pre>Done </pre>",[])}
end.
handle_res(A, [{head, Name}|T]) ->
io:format("head:~p~n",[Name]),
handle_res(A, T);
handle_res(A, [{part_body, Data}|T]) ->
io:format("part_body:~p~n",[Data]),
handle_res(A, T);
handle_res(A, [{body, Data}|T]) ->
io:format("body:~p~n",[Data]),
handle_res(A, T);
handle_res(A, []) ->
io:format("End_res~n").
</erl>
git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@136 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52