Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_output.c
Show First 20 Lines • Show All 2,160 Lines • ▼ Show 20 Lines | if (V_tcp_do_autosndbuf && so->so_snd.sb_flags & SB_AUTOSIZE) { | ||||
lowat = V_tcp_sendbuf_auto_lowat ? so->so_snd.sb_lowat : 0; | lowat = V_tcp_sendbuf_auto_lowat ? so->so_snd.sb_lowat : 0; | ||||
if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - lowat && | if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - lowat && | ||||
sbused(&so->so_snd) >= | sbused(&so->so_snd) >= | ||||
(so->so_snd.sb_hiwat / 8 * 7) - lowat && | (so->so_snd.sb_hiwat / 8 * 7) - lowat && | ||||
sbused(&so->so_snd) < V_tcp_autosndbuf_max && | sbused(&so->so_snd) < V_tcp_autosndbuf_max && | ||||
sendwin >= (sbused(&so->so_snd) - | sendwin >= (sbused(&so->so_snd) - | ||||
(tp->snd_nxt - tp->snd_una))) { | (tp->snd_nxt - tp->snd_una))) { | ||||
if (!sbreserve_locked(&so->so_snd, | if (!sbreserve_locked(so, SO_SND, | ||||
min(so->so_snd.sb_hiwat + V_tcp_autosndbuf_inc, | min(so->so_snd.sb_hiwat + V_tcp_autosndbuf_inc, | ||||
V_tcp_autosndbuf_max), so, curthread)) | V_tcp_autosndbuf_max), curthread)) | ||||
so->so_snd.sb_flags &= ~SB_AUTOSIZE; | so->so_snd.sb_flags &= ~SB_AUTOSIZE; | ||||
} | } | ||||
} | } | ||||
} | } |