test_http_connection fix

This commit is contained in:
Arvid Norberg
2008-11-14 07:59:54 +00:00
parent 55dd21c993
commit 5e5643f7a7
2 changed files with 6 additions and 5 deletions

View File

@@ -149,7 +149,7 @@ void start_web_server(int port, bool ssl)
"ssl.pemfile = \"server.pem\"\n"; "ssl.pemfile = \"server.pem\"\n";
f.close(); f.close();
system("lighttpd -f lighty_config &"); system("lighttpd -f lighty_config 2> lighty.err >lighty.log &");
test_sleep(1000); test_sleep(1000);
} }

View File

@@ -87,8 +87,6 @@ void http_handler(error_code const& ec, http_parser const& parser
} }
} }
print_http_header(parser); print_http_header(parser);
cq.close();
} }
void reset_globals() void reset_globals()
@@ -109,7 +107,7 @@ void run_test(std::string const& url, int size, int status, int connected
boost::shared_ptr<http_connection> h(new http_connection(ios, cq boost::shared_ptr<http_connection> h(new http_connection(ios, cq
, &::http_handler, true, &::http_connect_handler)); , &::http_handler, true, &::http_connect_handler));
h->get(url, seconds(5), 0, &ps); h->get(url, seconds(1), 0, &ps);
ios.reset(); ios.reset();
error_code e; error_code e;
ios.run(e); ios.run(e);
@@ -162,7 +160,10 @@ int test_main()
{ {
std::srand(std::time(0)); std::srand(std::time(0));
std::generate(data_buffer, data_buffer + sizeof(data_buffer), &std::rand); std::generate(data_buffer, data_buffer + sizeof(data_buffer), &std::rand);
std::ofstream("test_file").write(data_buffer, 3216); std::ofstream test_file("test_file", std::ios::trunc);
test_file.write(data_buffer, 3216);
TEST_CHECK(test_file.good());
test_file.close();
std::system("gzip -9 -c test_file > test_file.gz"); std::system("gzip -9 -c test_file > test_file.gz");
proxy_settings ps; proxy_settings ps;