diff options
author | Xin Long <lucien.xin@gmail.com> | 2017-02-18 18:52:46 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-20 16:26:09 +0100 |
commit | 4ea0c32f5f42f7ef33a7ecfb9b61ff0cad9b3c08 (patch) | |
tree | ef5b3d50db0a6e1839f48be2b8484d11ab2ba9a2 /net/sctp/socket.c | |
parent | sctp: flush out queue once assoc state falls into SHUTDOWN_PENDING (diff) | |
download | linux-4ea0c32f5f42f7ef33a7ecfb9b61ff0cad9b3c08.tar.xz linux-4ea0c32f5f42f7ef33a7ecfb9b61ff0cad9b3c08.zip |
sctp: add support for MSG_MORE
This patch is to add support for MSG_MORE on sctp.
It adds force_delay in sctp_datamsg to save MSG_MORE, and sets it after
creating datamsg according to the send flag. sctp_packet_can_append_data
then uses it to decide if the chunks of this msg will be sent at once or
delay it.
Note that unlike [1], this patch saves MSG_MORE in datamsg, instead of
in assoc. As sctp enqueues the chunks first, then dequeue them one by
one. If it's saved in assoc,the current msg's send flag (MSG_MORE) may
affect other chunks' bundling.
Since last patch, sctp flush out queue once assoc state falls into
SHUTDOWN_PENDING, the close block problem mentioned in [1] has been
solved as well.
[1] https://patchwork.ozlabs.org/patch/372404/
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 75f35cea4371..b5321486fbed 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -1964,6 +1964,7 @@ static int sctp_sendmsg(struct sock *sk, struct msghdr *msg, size_t msg_len) err = PTR_ERR(datamsg); goto out_free; } + datamsg->force_delay = !!(msg->msg_flags & MSG_MORE); /* Now send the (possibly) fragmented message. */ list_for_each_entry(chunk, &datamsg->chunks, frag_list) { |