aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server
diff options
context:
space:
mode:
authorBernard Duggan <[email protected]>2011-02-23 15:55:37 +1100
committerNiclas Axelsson <[email protected]>2011-02-24 17:54:12 +0100
commit73f261d2f44a58fda92e3d6e035051c11c3e4521 (patch)
tree797de791e8bb05cbf20512a65a5ad102a1ac725b /lib/inets/src/http_server
parent7bc880298b2f0994f2902cb0290e4fd035b01865 (diff)
downloadotp-73f261d2f44a58fda92e3d6e035051c11c3e4521.tar.gz
otp-73f261d2f44a58fda92e3d6e035051c11c3e4521.tar.bz2
otp-73f261d2f44a58fda92e3d6e035051c11c3e4521.zip
Modify mod_esi:deliver/2 to accept binary data
This change allows for more efficient delivery of large amounts of data through the mod_esi interface when the handling process has that data in binary format. It avoids the need to convert to list and the extra memory involved in passing that list between processes.
Diffstat (limited to 'lib/inets/src/http_server')
-rw-r--r--lib/inets/src/http_server/mod_esi.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/inets/src/http_server/mod_esi.erl b/lib/inets/src/http_server/mod_esi.erl
index 929185a67a..b85c479693 100644
--- a/lib/inets/src/http_server/mod_esi.erl
+++ b/lib/inets/src/http_server/mod_esi.erl
@@ -452,6 +452,10 @@ handle_body(Pid, ModData, Body, Timeout, Size, IsDisableChunkedSend) ->
?hdrt("handle_body - send chunk", [{timeout, Timeout}, {size, Size}]),
httpd_response:send_chunk(ModData, Body, IsDisableChunkedSend),
receive
+ {esi_data, Data} when is_binary(Data) ->
+ ?hdrt("handle_body - received binary data (esi)", []),
+ handle_body(Pid, ModData, Data, Timeout, Size + byte_size(Data),
+ IsDisableChunkedSend);
{esi_data, Data} ->
?hdrt("handle_body - received data (esi)", []),
handle_body(Pid, ModData, Data, Timeout, Size + length(Data),