65 lines
2.6 KiB
Diff
65 lines
2.6 KiB
Diff
|
When compiling with GCC 7.5, non-trivial initializers are unsupported.
|
||
|
|
||
|
[ 9s] shrpx_http_test.cc: In function 'void shrpx::test_shrpx_http_create_altsvc_header_value()':
|
||
|
[ 9s] shrpx_http_test.cc:152:9: sorry, unimplemented: non-trivial designated initializers not supported
|
||
|
[ 9s] },
|
||
|
[ 9s] ^
|
||
|
[ 9s] shrpx_http_test.cc:152:9: sorry, unimplemented: non-trivial designated initializers not supported
|
||
|
[ 9s] shrpx_http_test.cc:153:5: error: no matching function for call to 'std::vector<shrpx::AltSvc>::vector(<brace-enclosed initializer list>)'
|
||
|
[ 9s] };
|
||
|
[ 9s] ^
|
||
|
|
||
|
Index: nghttp2-1.60.0/src/shrpx_http_test.cc
|
||
|
===================================================================
|
||
|
--- nghttp2-1.60.0.orig/src/shrpx_http_test.cc
|
||
|
+++ nghttp2-1.60.0/src/shrpx_http_test.cc
|
||
|
@@ -143,14 +143,12 @@ void test_shrpx_http_create_affinity_coo
|
||
|
void test_shrpx_http_create_altsvc_header_value(void) {
|
||
|
{
|
||
|
BlockAllocator balloc(1024, 1024);
|
||
|
- std::vector<AltSvc> altsvcs{
|
||
|
- AltSvc{
|
||
|
- .protocol_id = StringRef::from_lit("h3"),
|
||
|
- .host = StringRef::from_lit("127.0.0.1"),
|
||
|
- .service = StringRef::from_lit("443"),
|
||
|
- .params = StringRef::from_lit("ma=3600"),
|
||
|
- },
|
||
|
- };
|
||
|
+ AltSvc s;
|
||
|
+ s.protocol_id = StringRef::from_lit("h3");
|
||
|
+ s.host = StringRef::from_lit("127.0.0.1");
|
||
|
+ s.service = StringRef::from_lit("443");
|
||
|
+ s.params = StringRef::from_lit("ma=3600");
|
||
|
+ std::vector<AltSvc> altsvcs = {s};
|
||
|
|
||
|
assert_stdstring_equal(
|
||
|
R"(h3="127.0.0.1:443"; ma=3600)",
|
||
|
@@ -159,19 +157,15 @@ void test_shrpx_http_create_altsvc_heade
|
||
|
|
||
|
{
|
||
|
BlockAllocator balloc(1024, 1024);
|
||
|
- std::vector<AltSvc> altsvcs{
|
||
|
- AltSvc{
|
||
|
- .protocol_id = StringRef::from_lit("h3"),
|
||
|
- .service = StringRef::from_lit("443"),
|
||
|
- .params = StringRef::from_lit("ma=3600"),
|
||
|
- },
|
||
|
- AltSvc{
|
||
|
- .protocol_id = StringRef::from_lit("h3%"),
|
||
|
- .host = StringRef::from_lit("\"foo\""),
|
||
|
- .service = StringRef::from_lit("4433"),
|
||
|
- },
|
||
|
- };
|
||
|
+ AltSvc s1, s2;
|
||
|
+ s1.protocol_id = StringRef::from_lit("h3");
|
||
|
+ s1.service = StringRef::from_lit("443");
|
||
|
+ s1.params = StringRef::from_lit("ma=3600");
|
||
|
+ s2.protocol_id = StringRef::from_lit("h3%");
|
||
|
+ s2.host = StringRef::from_lit("\"foo\"");
|
||
|
+ s2.service = StringRef::from_lit("4433");
|
||
|
|
||
|
+ std::vector<AltSvc> altsvcs = {s1, s2};
|
||
|
assert_stdstring_equal(
|
||
|
R"(h3=":443"; ma=3600, h3%25="\"foo\":4433")",
|
||
|
http::create_altsvc_header_value(balloc, altsvcs).str());
|