HTTP data server updates
Check of enable-http-data config option HTTP/2 Return 400 bad request if no path match Test: updated yang file revisions, extended restconf config with http-data
This commit is contained in:
parent
2a8cedf0c3
commit
404d05950a
10 changed files with 243 additions and 136 deletions
|
|
@ -90,9 +90,10 @@ struct restconf_handle {
|
|||
event_stream_t *rh_stream; /* notification streams, see clixon_stream.[ch] */
|
||||
|
||||
/* ------ end of common handle ------ */
|
||||
clicon_hash_t *rh_params; /* restconf parameters, including http headers */
|
||||
clixon_auth_type_t rh_auth_type; /* authentication type */
|
||||
int rh_pretty; /* pretty-print for http replies */
|
||||
clicon_hash_t *rh_params; /* restconf parameters, including http headers */
|
||||
clixon_auth_type_t rh_auth_type; /* authentication type */
|
||||
int rh_pretty; /* pretty-print for http replies */
|
||||
int rh_http_data; /* enable-http-data (and if-feature http-data) */
|
||||
char *rh_fcgi_socket; /* if-feature fcgi, XXX: use WITH_RESTCONF_FCGI ? */
|
||||
};
|
||||
|
||||
|
|
@ -228,12 +229,10 @@ restconf_pretty_get(clicon_handle h)
|
|||
}
|
||||
|
||||
/*! Set restconf pretty-print
|
||||
* @param[in] h Clicon handle
|
||||
* @param[in] name Data name
|
||||
* @param[in] val Data value as null-terminated string
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
* Currently using clixon runtime data but there is risk for colliding names
|
||||
* @param[in] h Clicon handle
|
||||
* @param[in] pretty 0 or 1
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
*/
|
||||
int
|
||||
restconf_pretty_set(clicon_handle h,
|
||||
|
|
@ -245,6 +244,34 @@ restconf_pretty_set(clicon_handle h,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! Get restconf http-data
|
||||
* @param[in] h Clixon handle
|
||||
* @retval 0 Yes, http-data enabled
|
||||
* @retval 1 No, http-data disabled
|
||||
*/
|
||||
int
|
||||
restconf_http_data_get(clicon_handle h)
|
||||
{
|
||||
struct restconf_handle *rh = handle(h);
|
||||
|
||||
return rh->rh_http_data;
|
||||
}
|
||||
|
||||
/*! Set restconf http-data
|
||||
* @param[in] h Clixon handle
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
*/
|
||||
int
|
||||
restconf_http_data_set(clicon_handle h,
|
||||
int http_data)
|
||||
{
|
||||
struct restconf_handle *rh = handle(h);
|
||||
|
||||
rh->rh_http_data = http_data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Get restconf fcgi socket path
|
||||
* @param[in] h Clicon handle
|
||||
* @retval socketpath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue