mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Add a new sysctl variable kern.sominqueue to override the MINIMUM queue
specified in a listen(2) system call.
This commit is contained in:
parent
b16ed18b72
commit
0570e4476a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18365
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: uipc_socket2.c,v 1.12 1996/07/11 16:31:59 wollman Exp $
|
||||
* $Id: uipc_socket2.c,v 1.13 1996/08/19 19:22:26 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -60,6 +60,9 @@ static u_long sb_efficiency = 8; /* parameter for sbreserve() */
|
||||
SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
|
||||
0, "");
|
||||
|
||||
static int sominqueue = 0;
|
||||
SYSCTL_INT(_kern, KERN_SOMINQUEUE, sominqueue, CTLFLAG_RW, &sominqueue, 0, "");
|
||||
|
||||
/*
|
||||
* Procedures to manipulate state flags of socket
|
||||
* and do appropriate wakeups. Normal sequence from the
|
||||
@ -163,7 +166,8 @@ sonewconn1(head, connstatus)
|
||||
{
|
||||
register struct socket *so;
|
||||
|
||||
if (head->so_qlen > 3 * head->so_qlimit / 2)
|
||||
if ((head->so_qlen > 3 * head->so_qlimit / 2) &&
|
||||
(head->so_qlen > sominqueue))
|
||||
return ((struct socket *)0);
|
||||
MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT);
|
||||
if (so == NULL)
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: uipc_socket2.c,v 1.12 1996/07/11 16:31:59 wollman Exp $
|
||||
* $Id: uipc_socket2.c,v 1.13 1996/08/19 19:22:26 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -60,6 +60,9 @@ static u_long sb_efficiency = 8; /* parameter for sbreserve() */
|
||||
SYSCTL_INT(_kern, OID_AUTO, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency,
|
||||
0, "");
|
||||
|
||||
static int sominqueue = 0;
|
||||
SYSCTL_INT(_kern, KERN_SOMINQUEUE, sominqueue, CTLFLAG_RW, &sominqueue, 0, "");
|
||||
|
||||
/*
|
||||
* Procedures to manipulate state flags of socket
|
||||
* and do appropriate wakeups. Normal sequence from the
|
||||
@ -163,7 +166,8 @@ sonewconn1(head, connstatus)
|
||||
{
|
||||
register struct socket *so;
|
||||
|
||||
if (head->so_qlen > 3 * head->so_qlimit / 2)
|
||||
if ((head->so_qlen > 3 * head->so_qlimit / 2) &&
|
||||
(head->so_qlen > sominqueue))
|
||||
return ((struct socket *)0);
|
||||
MALLOC(so, struct socket *, sizeof(*so), M_SOCKET, M_DONTWAIT);
|
||||
if (so == NULL)
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
|
||||
* $Id: sysctl.h,v 1.43 1996/07/25 18:02:14 wollman Exp $
|
||||
* $Id: sysctl.h,v 1.44 1996/09/10 23:31:13 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_SYSCTL_H_
|
||||
@ -223,7 +223,8 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
|
||||
#define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */
|
||||
#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
|
||||
#define KERN_USRSTACK 33 /* int: address of USRSTACK */
|
||||
#define KERN_MAXID 34 /* number of valid kern ids */
|
||||
#define KERN_SOMINQUEUE 34 /* int: override socket listen() */
|
||||
#define KERN_MAXID 35 /* number of valid kern ids */
|
||||
|
||||
#define CTL_KERN_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
@ -260,6 +261,7 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
|
||||
{ "maxsockbuf", CTLTYPE_INT }, \
|
||||
{ "ps_strings", CTLTYPE_INT }, \
|
||||
{ "usrstack", CTLTYPE_INT }, \
|
||||
{ "sominqueue", CTLTYPE_INT }, \
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user