From 470baff61f59321e2e246563a89664322e98df70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 5 May 2011 17:11:27 +0200 Subject: Add headers_huge test, demonstrating issue #3 is fixed. The previous commit switching to raw recv + erlang:decode_packet/3 works around the OTP bug regarding headers size in http recv. --- test/http_SUITE.erl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test/http_SUITE.erl') diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index c04c3d8..6b1a70f 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -18,7 +18,8 @@ -export([all/0, groups/0, init_per_suite/1, end_per_suite/1, init_per_group/2, end_per_group/2]). %% ct. --export([headers_dupe/1, nc_rand/1, pipeline/1, raw/1]). %% http. +-export([headers_dupe/1, headers_huge/1, + nc_rand/1, pipeline/1, raw/1]). %% http. -export([http_200/1, http_404/1, websocket/1]). %% http and https. %% ct. @@ -28,7 +29,8 @@ all() -> groups() -> BaseTests = [http_200, http_404], - [{http, [], [headers_dupe, nc_rand, pipeline, raw, websocket] ++ BaseTests}, + [{http, [], [headers_dupe, headers_huge, + nc_rand, pipeline, raw, websocket] ++ BaseTests}, {https, [], BaseTests}]. init_per_suite(Config) -> @@ -100,6 +102,12 @@ headers_dupe(Config) -> nomatch = binary:match(Data, <<"Connection: keep-alive">>), ok = gen_tcp:close(Socket). +headers_huge(Config) -> + Cookie = lists:flatten(["whatever_man_biiiiiiiiiiiig_cookie_me_want_77=" + "Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)" || _N <- lists:seq(1, 1000)]), + {_Packet, 200} = raw_req(["GET / HTTP/1.0\r\nHost: localhost\r\n" + "Set-Cookie: ", Cookie, "\r\n\r\n"], Config). + nc_rand(Config) -> Cat = os:find_executable("cat"), Nc = os:find_executable("nc"), -- cgit v1.2.3