libubus: attempt to receive data before calling poll
Data is often already present here Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
4daab27d00
commit
76ea27a627
1 changed files with 3 additions and 3 deletions
|
@ -174,9 +174,6 @@ static int recv_retry(struct ubus_context *ctx, struct iovec *iov, bool wait, in
|
|||
};
|
||||
|
||||
while (iov->iov_len > 0) {
|
||||
if (wait)
|
||||
wait_data(fd, false);
|
||||
|
||||
if (recv_fd) {
|
||||
msghdr.msg_control = &fd_buf;
|
||||
msghdr.msg_controllen = sizeof(fd_buf);
|
||||
|
@ -210,6 +207,9 @@ static int recv_retry(struct ubus_context *ctx, struct iovec *iov, bool wait, in
|
|||
iov->iov_len -= bytes;
|
||||
iov->iov_base += bytes;
|
||||
total += bytes;
|
||||
|
||||
if (iov->iov_len > 0)
|
||||
wait_data(fd, false);
|
||||
}
|
||||
|
||||
return total;
|
||||
|
|
Loading…
Reference in a new issue