size_t ctrllen;
unsigned char control[128];
struct iovec iov[16];
+ unsigned more;
int ioc, ret, i;
debug("-->rxrpc_send_data(%u,0x%x)\n", call->state, call->data_count);
abort();
}
+more_to_send:
/* Request an operation */
ctrllen = 0;
RXRPC_ADD_CALLID(control, ctrllen, (unsigned long)call);
free(sent);
}
+ more = MSG_MORE;
for (ioc = 0; ioc < 16; ioc++) {
rxrpc_check_buf(cursor);
iov[ioc].iov_base = cursor->buf + io_cursor;
iov[ioc].iov_len = end - io_cursor;
if (cursor == call->buffer_tail) {
+ if (!call->more)
+ more = 0;
ioc++;
break;
}
+ cursor = cursor->next;
}
msg.msg_iovlen = ioc;
debug("IOV[%02u] %04zu %p\n",
i, msg.msg_iov[i].iov_len, msg.msg_iov[i].iov_base);
- ret = sendmsg(call->conn->fd, &msg, call->more ? MSG_MORE : 0) == -1 ? -1 : 0;
- debug("SENDMSG: %d\n", ret);
+ ret = sendmsg(call->conn->fd, &msg, more);
+ debug("SENDMSG: %d%s\n", ret, more ? " [more]" : "");
if (ret == -1)
return -1;
rxrpc_check_call(call);
+ if (call->data_count > 0)
+ goto more_to_send;
if (call->data_count == 0 && !call->more)
call->state++;