From 463aa155441eeef585c659d231ec7240c328f6c2 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Mon, 2 May 2022 10:28:24 +0200 Subject: [PATCH] Restconf compile warnings and docs --- apps/restconf/clixon_http1_parse.l | 1 - apps/restconf/clixon_http_data.c | 4 ++-- apps/restconf/restconf_lib.c | 4 ++-- apps/restconf/restconf_main_native.c | 4 ++-- apps/restconf/restconf_native.h | 2 +- apps/restconf/restconf_nghttp2.c | 3 ++- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/restconf/clixon_http1_parse.l b/apps/restconf/clixon_http1_parse.l index 40cc064f..1745f34b 100644 --- a/apps/restconf/clixon_http1_parse.l +++ b/apps/restconf/clixon_http1_parse.l @@ -143,7 +143,6 @@ query [A-Za-z0-9\-\._~!$&'()*+,;=:@?/]|%[0-9a-fA-F][0-9a-fA-F] _HY->hy_linenum++; return BODY; } <> { return X_EOF; } -. { clixon_http1_parseerror(_HY, "LEXICAL ERROR\n"); return ERROR; } %% diff --git a/apps/restconf/clixon_http_data.c b/apps/restconf/clixon_http_data.c index adf92ec7..2aef39b1 100644 --- a/apps/restconf/clixon_http_data.c +++ b/apps/restconf/clixon_http_data.c @@ -279,7 +279,7 @@ api_http_data_file(clicon_handle h, { int retval = -1; cbuf *cbfile = NULL; - char *filename; + char *filename = NULL; cbuf *cbdata = NULL; FILE *f = NULL; off_t fsz = 0; @@ -371,8 +371,8 @@ api_http_data_file(clicon_handle h, if (restconf_reply_send(req, 200, cbdata, head) < 0) goto done; cbdata = NULL; /* consumed by reply-send */ - ok: clicon_debug(1, "%s Read %s OK", __FUNCTION__, filename); + ok: retval = 0; done: if (str) diff --git a/apps/restconf/restconf_lib.c b/apps/restconf/restconf_lib.c index 355edd70..cff775bd 100644 --- a/apps/restconf/restconf_lib.c +++ b/apps/restconf/restconf_lib.c @@ -798,9 +798,9 @@ restconf_config_init(clicon_handle h, strcmp(bstr, "true") == 0) { restconf_http_data_set(h, 1); } - else if (strcmp(bstr, "false") == 0){ + else restconf_http_data_set(h, 0); - } + /* Check if fcgi-socket is true and that feature is enabled * It is protected by if-feature fcgi, which means if the feature is not enabled, then * YANG spec will exist but by ANYDATA diff --git a/apps/restconf/restconf_main_native.c b/apps/restconf/restconf_main_native.c index efc44e6b..4e08a08a 100644 --- a/apps/restconf/restconf_main_native.c +++ b/apps/restconf/restconf_main_native.c @@ -583,7 +583,7 @@ ssl_alpn_check(clicon_handle h, int ret; cbuf *cberr = NULL; - clicon_debug(1, "%s", __FUNCTION__); + clicon_debug(1, "%s %s", __FUNCTION__, alpn); /* Alternatively, call restconf_str2proto but alpn is not a proper string */ if (alpn && alpnlen == 8 && memcmp("http/1.1", alpn, 8) == 0){ *proto = HTTP_11; @@ -612,7 +612,7 @@ ssl_alpn_check(clicon_handle h, } else{ /* XXX Sending badrequest here gives a segv in SSL_shutdown() later or a SIGPIPE here */ - clicon_log(LOG_INFO, "%s Warning: ALPN: No protocol selected", __FUNCTION__); + clicon_log(LOG_INFO, "%s Warning: ALPN: No protocol selected, or no ALPN?", __FUNCTION__); } if (rc->rc_ssl){ diff --git a/apps/restconf/restconf_native.h b/apps/restconf/restconf_native.h index b84740fc..c08863a2 100644 --- a/apps/restconf/restconf_native.h +++ b/apps/restconf/restconf_native.h @@ -99,7 +99,7 @@ typedef struct restconf_conn { clicon_handle rc_h; /* Clixon handle */ SSL *rc_ssl; /* Structure for SSL connection */ restconf_stream_data *rc_streams; /* List of http/2 session streams */ - int rc_exit; /* Set to close socket server-side (NYI) */ + int rc_exit; /* Set to close socket server-side */ /* Decision to keep lib-specific data here, otherwise new struct necessary * drawback is specific includes need to go everywhere */ #ifdef HAVE_LIBNGHTTP2 diff --git a/apps/restconf/restconf_nghttp2.c b/apps/restconf/restconf_nghttp2.c index a67b5acd..fb534815 100644 --- a/apps/restconf/restconf_nghttp2.c +++ b/apps/restconf/restconf_nghttp2.c @@ -939,7 +939,8 @@ int http2_send_server_connection(restconf_conn *rc) { int retval = -1; - nghttp2_settings_entry iv[1] = {{NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100}}; + nghttp2_settings_entry iv[2] = {{NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100} + ,{NGHTTP2_SETTINGS_ENABLE_PUSH, 0}}; nghttp2_error ngerr; if ((ngerr = nghttp2_submit_settings(rc->rc_ngsession,