@@ -381,31 +381,31 @@ BOOST_AUTO_TEST_CASE( websocket_fail_unsupported_version ) {
381
381
BOOST_CHECK (called);
382
382
}
383
383
384
- /* BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri ) {
385
- std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
384
+ // BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri ) {
385
+ // std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
386
386
387
- server s;
388
- websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
389
- bool called = false;
390
- s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
391
- s.set_open_handler(bind(&on_open_print,&s,::_1));
387
+ // server s;
388
+ // websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
389
+ // bool called = false;
390
+ // s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
391
+ // s.set_open_handler(bind(&on_open_print,&s,::_1));
392
392
393
- std::cout << run_server_test(s,input,true) << std::endl;
394
- BOOST_CHECK(called);
395
- }
393
+ // std::cout << run_server_test(s,input,true) << std::endl;
394
+ // BOOST_CHECK(called);
395
+ // }
396
396
397
- BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri_http ) {
398
- std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nOrigin: http://www.example.com\r\n\r\n";
397
+ // BOOST_AUTO_TEST_CASE( websocket_fail_invalid_uri_http ) {
398
+ // std::string input = "GET http://345.123.123.123/foo HTTP/1.1\r\nHost: www.example.com\r\nOrigin: http://www.example.com\r\n\r\n";
399
399
400
- server s;
401
- websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
402
- bool called = false;
403
- s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
404
- s.set_open_handler(bind(&on_open_print,&s,::_1));
400
+ // server s;
401
+ // websocketpp::lib::error_code ec = make_error_code(websocketpp::error::unsupported_version);
402
+ // bool called = false;
403
+ // s.set_fail_handler(bind(&check_on_fail,&s,ec,websocketpp::lib::ref(called),::_1));
404
+ // s.set_open_handler(bind(&on_open_print,&s,::_1));
405
405
406
- std::cout << run_server_test(s,input,true) << std::endl;
407
- BOOST_CHECK(called);
408
- } */
406
+ // std::cout << run_server_test(s,input,true) << std::endl;
407
+ // BOOST_CHECK(called);
408
+ // }
409
409
410
410
BOOST_AUTO_TEST_CASE ( websocket_fail_upgrade_required ) {
411
411
std::string input = " GET /foo/bar HTTP/1.1\r\n Host: www.example.com\r\n Origin: http://www.example.com\r\n\r\n " ;
@@ -423,26 +423,26 @@ BOOST_AUTO_TEST_CASE( websocket_fail_upgrade_required ) {
423
423
// TODO: set max message size mid connection test case
424
424
// TODO: [maybe] set max message size in open handler
425
425
426
- /*
427
426
428
- BOOST_AUTO_TEST_CASE( user_reject_origin ) {
429
- std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example2.com\r\n\r\n";
430
- std::string output = "HTTP/1.1 403 Forbidden\r\nServer: "+websocketpp::USER_AGENT+"\r\n\r\n";
431
427
432
- BOOST_CHECK(run_server_test(input) == output);
433
- }
428
+ // BOOST_AUTO_TEST_CASE( user_reject_origin ) {
429
+ // std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example2.com\r\n\r\n";
430
+ // std::string output = "HTTP/1.1 403 Forbidden\r\nServer: "+websocketpp::USER_AGENT+"\r\n\r\n";
434
431
435
- BOOST_AUTO_TEST_CASE( basic_text_message ) {
436
- std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n";
432
+ // BOOST_CHECK(run_server_test(input) == output);
433
+ // }
437
434
438
- unsigned char frames[8] = {0x82,0x82,0xFF,0xFF,0xFF,0xFF,0xD5,0xD5};
439
- input.append(reinterpret_cast<char*>(frames),8) ;
435
+ // BOOST_AUTO_TEST_CASE( basic_text_message ) {
436
+ // std::string input = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 13\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\nOrigin: http://www.example.com\r\n\r\n" ;
440
437
441
- std::string output = "HTTP/1.1 101 Switching Protocols\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\nServer: "+websocketpp::USER_AGENT+"\r\nUpgrade: websocket\r\n\r\n**";
438
+ // unsigned char frames[8] = {0x82,0x82,0xFF,0xFF,0xFF,0xFF,0xD5,0xD5};
439
+ // input.append(reinterpret_cast<char*>(frames),8);
440
+
441
+ // std::string output = "HTTP/1.1 101 Switching Protocols\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\nServer: "+websocketpp::USER_AGENT+"\r\nUpgrade: websocket\r\n\r\n**";
442
+
443
+ // BOOST_CHECK( run_server_test(input) == output);
444
+ // }
442
445
443
- BOOST_CHECK( run_server_test(input) == output);
444
- }
445
- */
446
446
447
447
448
448
0 commit comments