diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-10 12:08:23 +0200 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2025-08-11 10:15:32 +0200 |
commit | 5c9328203b277fc36550ba06720dd13e5940121b (patch) | |
tree | 92fb49323a0fdda7d696915800eb0af909fa7319 /src/irmd | |
parent | 2fd016776bca60e0a2bff69a9f130e4c3415bb4c (diff) | |
download | ouroboros-5c9328203b277fc36550ba06720dd13e5940121b.tar.gz ouroboros-5c9328203b277fc36550ba06720dd13e5940121b.zip |
ipcpd: Remove old IPCP_CONN_WAIT_DIR build option
The IPCP_CONN_WAIT_DIR build option is not needed anymore with the
recent update to the DHT. Also cleans up some logging in the IPCP.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/irmd')
-rw-r--r-- | src/irmd/ipcp.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index 8a42be42..1e8980fb 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -85,11 +85,10 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, uint8_t buf[SOCK_BUF_SIZE]; char * spath; ssize_t len; - ipcp_msg_t * recv_msg; struct timeval tv; struct timespec tic; struct timespec toc; - bool dealloc = false; + bool may_fail = false; if (kill(pid, 0) < 0) return NULL; @@ -127,6 +126,7 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, tv.tv_usec = (REG_TIMEOUT % 1000) * 1000; break; case IPCP_MSG_CODE__IPCP_QUERY: + may_fail = true; /* name not always in Layer */ tv.tv_sec = QUERY_TIMEOUT / 1000; tv.tv_usec = (QUERY_TIMEOUT % 1000) * 1000; break; @@ -139,7 +139,7 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, tv.tv_usec = (FLOW_ALLOC_TIMEOUT % 1000) * 1000; break; case IPCP_MSG_CODE__IPCP_FLOW_DEALLOC: - dealloc = true; + may_fail = true; tv.tv_sec = 0; /* FIX DEALLOC: don't wait for dealloc */ tv.tv_usec = 500; break; @@ -167,17 +167,15 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, pthread_cleanup_pop(true); /* close socket */ if (len > 0) - recv_msg = ipcp_msg__unpack(NULL, len, buf); - else { - if (errno == EAGAIN && !dealloc) { - int diff = ts_diff_ms(&toc, &tic); - log_warn("IPCP %s timed out after %d ms.", - str_ipcp_cmd(msg->code), diff); - } - return NULL; + return ipcp_msg__unpack(NULL, len, buf); + + if (errno == EAGAIN && !may_fail) { + int diff = ts_diff_ms(&toc, &tic); + log_warn("IPCP %s timed out after %d ms.", + str_ipcp_cmd(msg->code), diff); } - return recv_msg; + return NULL; } int ipcp_bootstrap(pid_t pid, |