Fix compile error (again) with gcc and --enable-werror

This commit is contained in:
Tatsuhiro Tsujikawa 2016-04-09 22:01:15 +09:00
parent 9e64d10223
commit 9c0bd8c60a
2 changed files with 5 additions and 6 deletions

View File

@ -223,6 +223,9 @@ static void run_nghttp2_session_send_server(void) {
int rv; int rv;
const uint8_t *txdata; const uint8_t *txdata;
ssize_t txdatalen; ssize_t txdatalen;
const uint8_t origin[] = "nghttp2.org";
const uint8_t altsvc_field_value[] = "h2=\":443\"";
rv = nghttp2_session_callbacks_new(&callbacks); rv = nghttp2_session_callbacks_new(&callbacks);
if (rv != 0) { if (rv != 0) {
return; return;
@ -237,9 +240,6 @@ static void run_nghttp2_session_send_server(void) {
return; return;
} }
const uint8_t origin[] = "nghttp2.org";
const uint8_t altsvc_field_value[] = "h2=\":443\"";
rv = nghttp2_submit_altsvc(session, NGHTTP2_FLAG_NONE, 0, origin, rv = nghttp2_submit_altsvc(session, NGHTTP2_FLAG_NONE, 0, origin,
sizeof(origin) - 1, altsvc_field_value, sizeof(origin) - 1, altsvc_field_value,
sizeof(altsvc_field_value) - 1); sizeof(altsvc_field_value) - 1);

View File

@ -5448,14 +5448,13 @@ void test_nghttp2_submit_altsvc(void) {
const uint8_t *data; const uint8_t *data;
nghttp2_frame_hd hd; nghttp2_frame_hd hd;
size_t origin_len; size_t origin_len;
const uint8_t origin[] = "nghttp2.org";
const uint8_t field_value[] = "h2=\":443\"";
memset(&callbacks, 0, sizeof(nghttp2_session_callbacks)); memset(&callbacks, 0, sizeof(nghttp2_session_callbacks));
nghttp2_session_server_new(&session, &callbacks, &ud); nghttp2_session_server_new(&session, &callbacks, &ud);
const uint8_t origin[] = "nghttp2.org";
const uint8_t field_value[] = "h2=\":443\"";
rv = nghttp2_submit_altsvc(session, NGHTTP2_FLAG_NONE, 0, origin, rv = nghttp2_submit_altsvc(session, NGHTTP2_FLAG_NONE, 0, origin,
sizeof(origin) - 1, field_value, sizeof(origin) - 1, field_value,
sizeof(field_value) - 1); sizeof(field_value) - 1);