diff options
author | Marcus Arendt <[email protected]> | 2014-05-22 10:40:00 +0200 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-05-22 10:40:00 +0200 |
commit | 97ec79ab4ab2e00de42e69534b0181eeccbadfc8 (patch) | |
tree | 4d99c17327cf45f7c27d7b0ff336c5f08626f623 /lib/inets/test | |
parent | f64c39daeff68af63b1864bf11313d566768a37f (diff) | |
parent | cf3c624dc66a42d9d7bec904d8be3b8c4cce38ae (diff) | |
download | otp-97ec79ab4ab2e00de42e69534b0181eeccbadfc8.tar.gz otp-97ec79ab4ab2e00de42e69534b0181eeccbadfc8.tar.bz2 otp-97ec79ab4ab2e00de42e69534b0181eeccbadfc8.zip |
Merge branch 'scrapinghub/stream_for_chunked_single_message' into maint
* scrapinghub/stream_for_chunked_single_message:
inets: Fix streaming with single chunk body
Diffstat (limited to 'lib/inets/test')
-rw-r--r-- | lib/inets/test/httpc_SUITE.erl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index b1b799c953..1c3bbcaa9c 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -94,6 +94,7 @@ only_simulated() -> empty_set_cookie, trace, stream_once, + stream_single_chunk, no_content_204, tolerate_missing_CR, userinfo, @@ -387,6 +388,13 @@ stream_once(Config) when is_list(Config) -> Request2 = {url(group_name(Config), "/once_chunked.html", Config), []}, stream_test(Request2, {stream, {self, once}}). +%%------------------------------------------------------------------------- +stream_single_chunk() -> + [{doc, "Test the option stream for asynchrony requests"}]. +stream_single_chunk(Config) when is_list(Config) -> + Request = {url(group_name(Config), "/single_chunk.html", Config), []}, + stream_test(Request, {stream, self}). + %%------------------------------------------------------------------------- redirect_multiple_choises() -> @@ -1047,7 +1055,7 @@ stream_test(Request, To) -> ct:fail(Msg) end, - Body == binary_to_list(StreamedBody). + Body = binary_to_list(StreamedBody). url(http, End, Config) -> Port = ?config(port, Config), @@ -1675,6 +1683,14 @@ handle_uri(_,"/once_chunked.html",_,_,Socket,_) -> http_chunk:encode("obar</BODY></HTML>")), http_chunk:encode_last(); +handle_uri(_,"/single_chunk.html",_,_,Socket,_) -> + Chunk = "HTTP/1.1 200 ok\r\n" ++ + "Transfer-Encoding:Chunked\r\n\r\n" ++ + http_chunk:encode("<HTML><BODY>fo") ++ + http_chunk:encode("obar</BODY></HTML>") ++ + http_chunk:encode_last(), + send(Socket, Chunk); + handle_uri(_,"/once.html",_,_,Socket,_) -> Head = "HTTP/1.1 200 ok\r\n" ++ "Content-Length:32\r\n\r\n", |