FreeBSD Bugzilla – Attachment 160359 Details for
Bug 202147
default listen queue in casperd is too small for some applications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
updated patch, set queue length to SOMAXCONN
casperd.diff.txt (text/plain), 2.22 KB, created by
Kurt Lidl
on 2015-08-25 19:34:55 UTC
(
hide
)
Description:
updated patch, set queue length to SOMAXCONN
Filename:
MIME Type:
Creator:
Kurt Lidl
Created:
2015-08-25 19:34:55 UTC
Size:
2.22 KB
patch
obsolete
>Index: sbin/casperd/casperd.8 >=================================================================== >--- sbin/casperd/casperd.8 (revision 287119) >+++ sbin/casperd/casperd.8 (working copy) >@@ -35,8 +35,8 @@ > .Nd "Capability Services friendly daemon" > .Sh SYNOPSIS > .Nm >-[-Fhv] [-D servconfdir] [-P pidfile] [-S sockpath] > .Op Fl Fhv >+.Op Fl l Ar listenqueue > .Op Fl D Ar servconfdir > .Op Fl P Ar pidfile > .Op Fl S Ar sockpath >@@ -74,6 +74,12 @@ > Print the > .Nm > usage message. >+.It Fl l Ar listenqueue >+Specify depth of socket listen queue for the >+.Nm >+daemon. >+The default queue length is >+.Pa SOMAXCONN . > .It Fl P Ar pidfile > Specify alternative location of a file where main process PID will be > stored. >Index: sbin/casperd/casperd.c >=================================================================== >--- sbin/casperd/casperd.c (revision 287119) >+++ sbin/casperd/casperd.c (working copy) >@@ -534,7 +534,7 @@ > } > > static void >-main_loop(const char *sockpath, struct pidfh *pfh) >+main_loop(int lqlen, const char *sockpath, struct pidfh *pfh) > { > fd_set fds; > struct sockaddr_un sun; >@@ -559,7 +559,7 @@ > if (bind(lsock, (struct sockaddr *)&sun, sizeof(sun)) == -1) > pjdlog_exit(1, "Unable to bind to %s", sockpath); > (void)umask(oldumask); >- if (listen(lsock, 8) == -1) >+ if (listen(lsock, lqlen) == -1) > pjdlog_exit(1, "Unable to listen on %s", sockpath); > > for (;;) { >@@ -627,7 +627,7 @@ > struct pidfh *pfh; > const char *pidfile, *servconfdir, *sockpath; > pid_t otherpid; >- int ch, debug; >+ int ch, debug, lqlen; > bool foreground; > > pjdlog_init(PJDLOG_MODE_STD); >@@ -634,11 +634,12 @@ > > debug = 0; > foreground = false; >+ lqlen = SOMAXCONN; > pidfile = CASPERD_PIDFILE; > servconfdir = CASPERD_SERVCONFDIR; > sockpath = CASPERD_SOCKPATH; > >- while ((ch = getopt(argc, argv, "D:FhP:S:v")) != -1) { >+ while ((ch = getopt(argc, argv, "D:Fhl:P:S:v")) != -1) { > switch (ch) { > case 'D': > servconfdir = optarg; >@@ -646,6 +647,11 @@ > case 'F': > foreground = true; > break; >+ case 'l': >+ lqlen = strtol(optarg, NULL, 0); >+ if (lqlen < 1) >+ lqlen = SOMAXCONN; >+ break; > case 'P': > pidfile = optarg; > break; >@@ -711,5 +717,5 @@ > /* > * Wait for connections. > */ >- main_loop(sockpath, pfh); >+ main_loop(lqlen, sockpath, pfh); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202147
:
159630
| 160359