Formatting and debugs
This commit is contained in:
parent
c377a28d56
commit
e2140aed10
7 changed files with 14 additions and 8 deletions
|
|
@ -87,7 +87,7 @@ Notes:
|
|||
|
||||
### Comments
|
||||
|
||||
Use `/* */`. Use `//` only for temporal comments.
|
||||
Use `/* */`. Use `//` only for temporary comments.
|
||||
|
||||
Do not use "======", ">>>>>" or "<<<<<<" in comments since git merge conflict uses that.
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@
|
|||
|
||||
/* Command line options to be passed to getopt(3) */
|
||||
#define CLI_OPTS "+hVD:f:E:l:C:F:1a:u:d:m:qp:GLy:c:U:o:"
|
||||
|
||||
/*! Check if there is a CLI history file and if so dump the CLI histiry to it
|
||||
*
|
||||
* Just log if file does not exist or is not readable
|
||||
|
|
|
|||
|
|
@ -748,7 +748,6 @@ clicon_cliread(clixon_handle h,
|
|||
goto done;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
retval = 1;
|
||||
done:
|
||||
if (pfmt)
|
||||
|
|
|
|||
|
|
@ -323,10 +323,12 @@ restconf_connection_sanity(clixon_handle h,
|
|||
char *media_str = NULL;
|
||||
char *oneline = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_RESTCONF, "");
|
||||
/* 1) Check if http/2 non-tls is disabled */
|
||||
if (rc->rc_ssl == NULL &&
|
||||
rc->rc_proto == HTTP_2 &&
|
||||
clicon_option_bool(h, "CLICON_RESTCONF_HTTP2_PLAIN") == 0){
|
||||
clixon_debug(CLIXON_DBG_RESTCONF, "Sanity check http/2 non-tls failed, disconnect");
|
||||
if (netconf_invalid_value_xml(&xerr, "protocol", "Only HTTP/2 with TLS is enabled, plain http/2 is disabled") < 0)
|
||||
goto done;
|
||||
if ((media_str = restconf_param_get(h, "HTTP_ACCEPT")) == NULL){
|
||||
|
|
@ -343,6 +345,7 @@ restconf_connection_sanity(clixon_handle h,
|
|||
/* 2) Check if ssl client cert is valid */
|
||||
else if (rc->rc_ssl != NULL &&
|
||||
(code = SSL_get_verify_result(rc->rc_ssl)) != 0){
|
||||
clixon_debug(CLIXON_DBG_RESTCONF, "Sanity check cert error SSL_get_verify_result: %ld, disconnect", code);
|
||||
/* Syslog cert failure */
|
||||
if (ssl_x509_name_oneline(rc->rc_ssl, &oneline) < 0)
|
||||
goto done;
|
||||
|
|
@ -372,6 +375,7 @@ restconf_connection_sanity(clixon_handle h,
|
|||
}
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_RESTCONF, "retval:%d", retval);
|
||||
if (oneline)
|
||||
free(oneline);
|
||||
if (cberr)
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ xmldb_multi_read_applyfn(cxobj *x,
|
|||
dbfile = cbuf_get(cb);
|
||||
clixon_debug(CLIXON_DBG_DATASTORE, "Parsing: %s", dbfile);
|
||||
if ((fp = fopen(dbfile, "r")) == NULL){
|
||||
clixon_err(OE_CFG, errno, "fdopen(%s)", dbfile);
|
||||
clixon_err(OE_CFG, errno, "fopen(%s)", dbfile);
|
||||
goto done;
|
||||
}
|
||||
switch (mr->mr_format){
|
||||
|
|
|
|||
|
|
@ -2245,8 +2245,10 @@ clixon_compare_xmls(cxobj *xc1,
|
|||
clixon_err(OE_UNDEF, errno, "tmpfile");
|
||||
goto done;
|
||||
}
|
||||
if ((f = fdopen(fd, "w")) == NULL)
|
||||
if ((f = fdopen(fd, "w")) == NULL){
|
||||
clixon_err(OE_XML, errno, "fdopen(%s)", filename1);
|
||||
goto done;
|
||||
}
|
||||
switch(format){
|
||||
case FORMAT_TEXT:
|
||||
if (clixon_text2file(f, xc1, 0, cligen_output, 1, 1) < 0)
|
||||
|
|
@ -2260,14 +2262,14 @@ clixon_compare_xmls(cxobj *xc1,
|
|||
}
|
||||
fclose(f);
|
||||
close(fd);
|
||||
|
||||
if ((fd = mkstemp(filename2)) < 0){
|
||||
clixon_err(OE_UNDEF, errno, "mkstemp: %s", strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
if ((f = fdopen(fd, "w")) == NULL)
|
||||
if ((f = fdopen(fd, "w")) == NULL){
|
||||
clixon_err(OE_XML, errno, "fdopen(%s)", filename2);
|
||||
goto done;
|
||||
|
||||
}
|
||||
switch(format){
|
||||
case FORMAT_TEXT:
|
||||
if (clixon_text2file(f, xc2, 0, cligen_output, 1, 1) < 0)
|
||||
|
|
|
|||
|
|
@ -1178,7 +1178,7 @@ xpath2canonical(const char *xpath0,
|
|||
* @param[in] xcur xml-tree where to search
|
||||
* @param[in] nsc External XML namespace context, or NULL
|
||||
* @param[in] xpath XPath syntax
|
||||
* @param[oit] count Nr of elements of xpath
|
||||
* @param[out] count Nr of elements of xpath
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
* @note This function is made for making optimizations in certain circumstances, such as a list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue