Commits

Tamas Nagy  committed d7d1032

Update simple_load to accomodate gen_httpd changes

  • Participants
  • Parent commits 0b6d472

Comments (0)

Files changed (1)

File test/simple_load.erl

 
 start_client(Host, Port, Clients) when Clients > 0 ->
 	process_flag(trap_exit, true),
-	{ok, Body} = file:read_file("tests/1M"),
+	{ok, Body} = file:read_file("test/1M"),
 	URL = "http://" ++ Host ++ ":" ++ integer_to_list(Port) ++ "/static/1M",
 	start(Clients, URL, Body, Clients).
 
 handle_continue(_Method, _URI, _Vsn, _ReqHdrs, CBState) ->
 	{continue, [], CBState}.
 
-handle_request(_Method, "/static/1M", {1,1}, _, Entity, State) ->
-	case Entity of
-		{identity, Reader} ->
-			case Reader(complete, 50000) of
-				{ok, Body} ->
+handle_request(_Method, "/static/1M", {1,1}, _, EntityBody, State) ->
+	case EntityBody of
+		{identity, EntityState} ->
+			case gen_httpd:read_body(complete, 50000, EntityState) of
+				{ok, {Body, http_eob}} ->
 					{reply, 200, [], Body, State};
 				{error, Reason} ->
 					{reply, 500, [], io_lib:format("~p", [Reason]), State}