Anonymous avatar Anonymous committed d7d1032

Update simple_load to accomodate gen_httpd changes

Comments (0)

Files changed (1)


 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}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.