diff options
author | Randall Stewart <rrs@FreeBSD.org> | 2007-12-04 20:20:42 +0000 |
---|---|---|
committer | Randall Stewart <rrs@FreeBSD.org> | 2007-12-04 20:20:42 +0000 |
commit | 2aedc03dad80de9605cbf6af9bd805cc6145207e (patch) | |
tree | f2a3355d296c6ea9fbd216bfdf4747a1f575ca5c /sys/netinet | |
parent | 9889281da3163ca3e7ef86c9fccc1bdd992d4477 (diff) | |
download | src-2aedc03dad80de9605cbf6af9bd805cc6145207e.tar.gz src-2aedc03dad80de9605cbf6af9bd805cc6145207e.zip |
- More fixes for the non-blocking msg send, had the skip of the pre-block
test incorrect.
- Fix the initial buf calculation to be more friendly, calc is the same
but we use different variable to make it easier amongst the different
code versions.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=174266
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/sctp_output.c | 7 | ||||
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index d648d1832644..d1c9d712cd10 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -11627,7 +11627,7 @@ sctp_lower_sosend(struct socket *so, local_add_more = sndlen; } len = 0; - if (non_blocking == 0) { + if (non_blocking) { goto skip_preblock; } if (((max_len <= local_add_more) && @@ -11667,8 +11667,9 @@ sctp_lower_sosend(struct socket *so, } inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); } - if (SCTP_SB_LIMIT_SND(so) > stcb->asoc.total_output_queue_size) { - max_len = SCTP_SB_LIMIT_SND(so) - stcb->asoc.total_output_queue_size; + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { + max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; } else { max_len = 0; } diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 070c9a747e1d..aea2db5bc74e 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -70,7 +70,7 @@ sctp_init(void) * the SB_MAX whichever is smaller for the send window. */ sb_max_adj = (u_long)((u_quad_t) (SB_MAX) * MCLBYTES / (MSIZE + MCLBYTES)); - sctp_sendspace = min((min(SB_MAX, sb_max_adj)), + sctp_sendspace = min(sb_max_adj, (((uint32_t) nmbclusters / 2) * SCTP_DEFAULT_MAXSEGMENT)); /* * Now for the recv window, should we take the same amount? or |