projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use non-blocking recvmsg() for data/ctrl connections of lttng-relayd
[lttng-tools.git]
/
src
/
common
/
sessiond-comm
/
inet.c
diff --git
a/src/common/sessiond-comm/inet.c
b/src/common/sessiond-comm/inet.c
index e48f2c9ad8195d7cf90bc76d48715e414a6d6d26..e0b3e7a96ffb1d13324ae0bbb9f7b58238df93be 100644
(file)
--- a/
src/common/sessiond-comm/inet.c
+++ b/
src/common/sessiond-comm/inet.c
@@
-384,18
+384,22
@@
ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
len_last = iov[0].iov_len;
ret = recvmsg(sock->fd, &msg, flags);
if (ret > 0) {
len_last = iov[0].iov_len;
ret = recvmsg(sock->fd, &msg, flags);
if (ret > 0) {
+ if (flags & MSG_DONTWAIT) {
+ goto end;
+ }
iov[0].iov_base += ret;
iov[0].iov_len -= ret;
assert(ret <= len_last);
}
} while ((ret > 0 && ret < len_last) || (ret < 0 && errno == EINTR));
iov[0].iov_base += ret;
iov[0].iov_len -= ret;
assert(ret <= len_last);
}
} while ((ret > 0 && ret < len_last) || (ret < 0 && errno == EINTR));
+
if (ret < 0) {
PERROR("recvmsg inet");
} else if (ret > 0) {
ret = len;
}
/* Else ret = 0 meaning an orderly shutdown. */
if (ret < 0) {
PERROR("recvmsg inet");
} else if (ret > 0) {
ret = len;
}
/* Else ret = 0 meaning an orderly shutdown. */
-
+end:
return ret;
}
return ret;
}
This page took
0.025014 seconds
and
4
git commands to generate.