Restconf compile warnings and docs

This commit is contained in:
Olof hagsand 2022-05-02 10:28:24 +02:00
parent 5551d753ef
commit 463aa15544
6 changed files with 9 additions and 9 deletions

View file

@ -143,7 +143,6 @@ query [A-Za-z0-9\-\._~!$&'()*+,;=:@?/]|%[0-9a-fA-F][0-9a-fA-F]
_HY->hy_linenum++; _HY->hy_linenum++;
return BODY; } return BODY; }
<BODYM><<EOF>> { return X_EOF; } <BODYM><<EOF>> { return X_EOF; }
<BODYM>. { clixon_http1_parseerror(_HY, "LEXICAL ERROR\n"); return ERROR; }
%% %%

View file

@ -279,7 +279,7 @@ api_http_data_file(clicon_handle h,
{ {
int retval = -1; int retval = -1;
cbuf *cbfile = NULL; cbuf *cbfile = NULL;
char *filename; char *filename = NULL;
cbuf *cbdata = NULL; cbuf *cbdata = NULL;
FILE *f = NULL; FILE *f = NULL;
off_t fsz = 0; off_t fsz = 0;
@ -371,8 +371,8 @@ api_http_data_file(clicon_handle h,
if (restconf_reply_send(req, 200, cbdata, head) < 0) if (restconf_reply_send(req, 200, cbdata, head) < 0)
goto done; goto done;
cbdata = NULL; /* consumed by reply-send */ cbdata = NULL; /* consumed by reply-send */
ok:
clicon_debug(1, "%s Read %s OK", __FUNCTION__, filename); clicon_debug(1, "%s Read %s OK", __FUNCTION__, filename);
ok:
retval = 0; retval = 0;
done: done:
if (str) if (str)

View file

@ -798,9 +798,9 @@ restconf_config_init(clicon_handle h,
strcmp(bstr, "true") == 0) { strcmp(bstr, "true") == 0) {
restconf_http_data_set(h, 1); restconf_http_data_set(h, 1);
} }
else if (strcmp(bstr, "false") == 0){ else
restconf_http_data_set(h, 0); restconf_http_data_set(h, 0);
}
/* Check if fcgi-socket is true and that feature is enabled /* 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 * It is protected by if-feature fcgi, which means if the feature is not enabled, then
* YANG spec will exist but by ANYDATA * YANG spec will exist but by ANYDATA

View file

@ -583,7 +583,7 @@ ssl_alpn_check(clicon_handle h,
int ret; int ret;
cbuf *cberr = NULL; 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 */ /* Alternatively, call restconf_str2proto but alpn is not a proper string */
if (alpn && alpnlen == 8 && memcmp("http/1.1", alpn, 8) == 0){ if (alpn && alpnlen == 8 && memcmp("http/1.1", alpn, 8) == 0){
*proto = HTTP_11; *proto = HTTP_11;
@ -612,7 +612,7 @@ ssl_alpn_check(clicon_handle h,
} }
else{ else{
/* XXX Sending badrequest here gives a segv in SSL_shutdown() later or a SIGPIPE here */ /* 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){ if (rc->rc_ssl){

View file

@ -99,7 +99,7 @@ typedef struct restconf_conn {
clicon_handle rc_h; /* Clixon handle */ clicon_handle rc_h; /* Clixon handle */
SSL *rc_ssl; /* Structure for SSL connection */ SSL *rc_ssl; /* Structure for SSL connection */
restconf_stream_data *rc_streams; /* List of http/2 session streams */ 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 /* Decision to keep lib-specific data here, otherwise new struct necessary
* drawback is specific includes need to go everywhere */ * drawback is specific includes need to go everywhere */
#ifdef HAVE_LIBNGHTTP2 #ifdef HAVE_LIBNGHTTP2

View file

@ -939,7 +939,8 @@ int
http2_send_server_connection(restconf_conn *rc) http2_send_server_connection(restconf_conn *rc)
{ {
int retval = -1; 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; nghttp2_error ngerr;
if ((ngerr = nghttp2_submit_settings(rc->rc_ngsession, if ((ngerr = nghttp2_submit_settings(rc->rc_ngsession,