summaryrefslogtreecommitdiff
path: root/src/lib/sockets.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-05 20:02:28 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-06 10:36:24 +0200
commite1c0714d5827cd927961f3a687d9720e6e9aa802 (patch)
treed8e793cffbe829d64855eaa5a429b90ebe3dc3a4 /src/lib/sockets.c
parentc6ad4f96f8bb2f1ee749e92308e7173523ddd0b8 (diff)
downloadouroboros-e1c0714d5827cd927961f3a687d9720e6e9aa802.tar.gz
ouroboros-e1c0714d5827cd927961f3a687d9720e6e9aa802.zip
lib, irmd: Implement flow allocation timeout
Setting the timeouts on flow_alloc and flow_accept will now work. This makes some changes to the UNIX sockets used for management communication between the APs, IRMd and IPCPs.
Diffstat (limited to 'src/lib/sockets.c')
-rw-r--r--src/lib/sockets.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/lib/sockets.c b/src/lib/sockets.c
index 3a26a2cf..63f928cf 100644
--- a/src/lib/sockets.c
+++ b/src/lib/sockets.c
@@ -95,23 +95,17 @@ static void close_ptr(void * o)
close(*(int *) o);
}
-static irm_msg_t * send_recv_irm_msg_timed(irm_msg_t * msg, bool timed)
+irm_msg_t * send_recv_irm_msg(irm_msg_t * msg)
{
int sockfd;
buffer_t buf;
ssize_t count = 0;
irm_msg_t * recv_msg = NULL;
- struct timeval tv = {(SOCKET_TIMEOUT / 1000),
- (SOCKET_TIMEOUT % 1000) * 1000};
sockfd = client_socket_open(IRM_SOCK_PATH);
if (sockfd < 0)
return NULL;
- if (timed)
- setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO,
- (void *) &tv, sizeof(tv));
-
buf.len = irm_msg__get_packed_size(msg);
if (buf.len == 0) {
close(sockfd);
@@ -141,12 +135,6 @@ static irm_msg_t * send_recv_irm_msg_timed(irm_msg_t * msg, bool timed)
return recv_msg;
}
-irm_msg_t * send_recv_irm_msg(irm_msg_t * msg)
-{ return send_recv_irm_msg_timed(msg, true); }
-
-irm_msg_t * send_recv_irm_msg_b(irm_msg_t * msg)
-{ return send_recv_irm_msg_timed(msg, false); }
-
char * ipcp_sock_path(pid_t api)
{
char * full_name = NULL;