-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use domain sockets when available #656
Comments
CUPS.org User: mike OK, I've holding this for 1.2, since that release has support for different socket address types and will not need as many workarounds as your patch needs for 1.1. Will add to 1.2 sometime today... |
CUPS.org User: mike OK, I've ported and committed to domain socket changes in CUPS 1.2 CVS. Please let me know if you run into any problems. Some general notes:
|
CUPS.org User: mike Fixed in Subversion repository. |
"domainsocket.patch": --- config.h /*
--- config.h.in /*
--- conf/cupsd.conf Ports/addresses that we listen to. The default port 631 is reservedfor the Internet Printing Protocol (IPP) and is what we use here.+# If Unix domain socket support is enabled the full path of the socket You can have multiple Port/Listen lines to listen to more than oneport or address, or to restrict access:@@ -408,6 +411,7 @@ Listen hostname:631Listen 1.2.3.4Listen 1.2.3.4:631+# Listen /private/var/run/cupsd NOTE: Unfortunately, most web browsers don't support TLS or HTTP Upgradesfor encryption. If you want to support web-based encryption you'll@@ -418,6 +422,7 @@ HostNameLookups: whether or not to do lookups on IP addresses to get a--- conf/cupsd.conf.in Ports/addresses that we listen to. The default port 631 is reservedfor the Internet Printing Protocol (IPP) and is what we use here.+# If Unix domain socket support is enabled the full path of the socket You can have multiple Port/Listen lines to listen to more than oneport or address, or to restrict access:@@ -408,6 +411,7 @@ Listen hostname:631Listen 1.2.3.4Listen 1.2.3.4:631+# Listen @CUPS_DEFAULT_DOMAINSOCKET@ NOTE: Unfortunately, most web browsers don't support TLS or HTTP Upgradesfor encryption. If you want to support web-based encryption you'll@@ -418,6 +422,7 @@ HostNameLookups: whether or not to do lookups on IP addresses to get a--- config-scripts/cups-network.m4 AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles) +dnl Check for unix domain socket support...
+CUPS_DEFAULT_DOMAINSOCKET=""
dnl if (ntohl(http->hostaddr.sin_addr.s_addr) != 0x7f000001 &&
+#ifdef HAVE_DOMAINSOCKETS /*
+#ifdef HAVE_DOMAINSOCKETS include <signal.h>include <sys/time.h>@@ -503,10 +507,95 @@
/*
+#ifdef HAVE_DOMAINSOCKETS
+#ifdef FD_CLOEXEC
+#ifdef SO_REUSEPORT
http->error = 0; #include "cups.h" @@ -69,6 +70,9 @@ +#ifdef HAVE_DOMAINSOCKETS /*
@@ -61,9 +63,16 @@
c->type = CUPS_PRINTER_CLASS;
+#ifdef HAVE_DOMAINSOCKETS
if (HostNameLookups)
if (address == 0x7f000001)
+#ifdef HAVE_DOMAINSOCKETS include <Security/SecureTransport.h>include <Security/SecIdentitySearch.h>@@ -232,6 +236,15 @@ if (NumListeners > 0)
return (1); #include "cupsd.h" +#ifdef HAVE_DOMAINSOCKETS
for (i = NumListeners, lis = Listeners; i > 0; i --, lis ++)
for (i = NumListeners, lis = Listeners; i > 0; i --, lis ++)
+#ifdef HAVE_DOMAINSOCKETS
SetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName,
|
Version: 1.2-feature
CUPS.org User: jlovell
Using domain sockets more than doubles our throughput. Here's some testspeed results:
INET sockets:
testspeed(8299): 5000 requests in 2.6s (0.001s/r, 1922.3r/s)
testspeed: Simulating 1 clients with 5000 requests to localhost with no encryption...
Domain sockets:
testspeed(6873): 5000 requests in 1.2s (0.000s/r, 4239.1r/s)
testspeed: Simulating 1 clients with 5000 requests to localhost with no encryption...
Domain sockets with the http buffer from STR 547:
testspeed(9990): 5000 requests in 0.9s (0.000s/r, 5404.7r/s)
testspeed: Simulating 1 clients with 5000 requests to localhost with no encryption...
I know you have security concerns with domain sockets but could you give a quick glance at this patch to see if you see any obvious problems or omissions?:
A few main points:
Thanks!
Jim
The text was updated successfully, but these errors were encountered: