Skip to content

Commit

Permalink
Fix the stream_body_set_resp test
Browse files Browse the repository at this point in the history
It was failing from time to time due to the response being sent
as two separate packets.
  • Loading branch information
Loïc Hoguin committed Jan 6, 2012
1 parent fd211d3 commit d2f1336
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/http_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,10 @@ The document has moved
{Packet, 400} = raw_req(Packet, Config).

stream_body_set_resp(Config) ->
{port, Port} = lists:keyfind(port, 1, Config),
{ok, Socket} = gen_tcp:connect("localhost", Port,
[binary, {active, false}, {packet, raw}]),
ok = gen_tcp:send(Socket, "GET /stream_body/set_resp HTTP/1.1\r\n"
"Host: localhost\r\nConnection: close\r\n\r\n"),
{ok, Data} = gen_tcp:recv(Socket, 0, 6000),
{_Start, _Length} = binary:match(Data, <<"stream_body_set_resp">>).
{Packet, 200} = raw_resp(
"GET /stream_body/set_resp HTTP/1.1\r\n"
"Host: localhost\r\nConnection: close\r\n\r\n", Config),
{_Start, _Length} = binary:match(Packet, <<"stream_body_set_resp">>).

static_mimetypes_function(Config) ->
TestURL = build_url("/static_mimetypes_function/test.html", Config),
Expand Down

0 comments on commit d2f1336

Please sign in to comment.