- IPC socket: add REUSEADDR when using IP (remove comment)
- Test: remove variable to use backend restconf, since that is the only option - Docs C-style: describe return values better
This commit is contained in:
parent
6e0e45aab7
commit
9fce0a1214
3 changed files with 8 additions and 9 deletions
|
|
@ -89,6 +89,7 @@ config_socket_init_ipv4(clicon_handle h,
|
|||
int s;
|
||||
struct sockaddr_in addr;
|
||||
uint16_t port;
|
||||
int one = 1;
|
||||
|
||||
port = clicon_sock_port(h);
|
||||
|
||||
|
|
@ -97,7 +98,7 @@ config_socket_init_ipv4(clicon_handle h,
|
|||
clicon_err(OE_UNIX, errno, "socket");
|
||||
return -1;
|
||||
}
|
||||
// setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one));
|
||||
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one));
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(port);
|
||||
|
|
|
|||
|
|
@ -74,13 +74,13 @@ Errors are typically declared as follows:
|
|||
All function returns that have return values must be checked
|
||||
|
||||
Default return values form a function are:
|
||||
0: OK
|
||||
-1: Fatal Error
|
||||
- `0` OK
|
||||
- `-1` Fatal Error
|
||||
|
||||
In some cases, Clixon uses three-value returns as follows:
|
||||
1: OK
|
||||
0: Invalid
|
||||
-1: Fatal error
|
||||
- `1` OK
|
||||
- `0` Invalid
|
||||
- `-1` Fatal error
|
||||
|
||||
### Return values
|
||||
|
||||
|
|
|
|||
|
|
@ -51,11 +51,9 @@ if [ "${WITH_RESTCONF}" = "native" ]; then
|
|||
# Create server certs and CA
|
||||
cacerts $cakey $cacert
|
||||
servercerts $cakey $cacert $srvkey $srvcert
|
||||
USEBACKEND=false
|
||||
else
|
||||
# Define default restconfig config: RESTCONFIG
|
||||
RESTCONFIG=$(restconf_config none false)
|
||||
USEBACKEND=false
|
||||
fi
|
||||
|
||||
# This is a fixed 'state' implemented in routing_backend. It is assumed to be always there
|
||||
|
|
@ -113,7 +111,7 @@ cat <<EOF > $cfg
|
|||
<CLICON_BACKEND_PIDFILE>/usr/local/var/$APPNAME/$APPNAME.pidfile</CLICON_BACKEND_PIDFILE>
|
||||
<CLICON_XMLDB_DIR>/usr/local/var/$APPNAME</CLICON_XMLDB_DIR>
|
||||
<CLICON_MODULE_LIBRARY_RFC7895>true</CLICON_MODULE_LIBRARY_RFC7895>
|
||||
<CLICON_BACKEND_RESTCONF_PROCESS>$USEBACKEND</CLICON_BACKEND_RESTCONF_PROCESS>
|
||||
<CLICON_BACKEND_RESTCONF_PROCESS>false</CLICON_BACKEND_RESTCONF_PROCESS>
|
||||
$RESTCONFIG <!-- only fcgi -->
|
||||
</clixon-config>
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue