You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2002/07/17 14:52:34 UTC

Re: FileDescriptorLimit & ScriptsockBacklog (was: [PATCH] increase file descriptor limit automatically at httpd start up)

Tsuyoshi SASAMOTO <na...@super.win.ne.jp> writes:

> How about to make a new directive such as "FileDescriptorLimit"?

I think this was solved differently.

> Also, how about "ScriptsockBacklog" - to specify the backlog number
> of the cgid socket.

+1, but can you figure out what is messed up with the parts of your
patch to add ScriptsockBacklog?  The patch shows a lot of lines
changed when they look the same (whitespace inadvertently changed I
guess).  I don't have time to hand-merge it.

Thanks a bunch,

Jeff

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: FileDescriptorLimit & ScriptsockBacklog

Posted by Tsuyoshi SASAMOTO <na...@super.win.ne.jp>.
>> Also, how about "ScriptsockBacklog" - to specify the backlog number
>> of the cgid socket.
>
>+1, but can you figure out what is messed up with the parts of your
>patch to add ScriptsockBacklog?  The patch shows a lot of lines
>changed when they look the same (whitespace inadvertently changed I
>guess).  I don't have time to hand-merge it.

Thanks... The patch eliminates extra whitespaces at EOL, such as:

-  statement; <EOL>
+  statement;<EOL>

Here is a patch that doesn't eliminate them.


Tsuyoshi SASAMOTO
nazonazo@super.win.ne.jp

--- httpd-2.0.39/modules/generators/mod_cgid.c	Fri Jun 14 04:41:17 2002
+++ httpd-2.0.39/modules/generators/mod_cgid.c	Thu Jul 18 09:49:56 2002
@@ -183,6 +183,7 @@
     const char *logname; 
     long logbytes; 
     int bufbytes; 
+    int sockbacklog;
 } cgid_server_conf; 
 
 /* If a request includes query info in the URL (stuff after "?"), and
@@ -544,7 +545,7 @@
         return errno;
     } 
 
-    if (listen(sd, DEFAULT_CGID_LISTENBACKLOG) < 0) {
+    if (listen(sd, sconf->sockbacklog) < 0) {
         ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, 
                      "Couldn't listen on unix domain socket"); 
         return errno;
@@ -723,6 +724,7 @@
     c->logname = NULL; 
     c->logbytes = DEFAULT_LOGBYTES; 
     c->bufbytes = DEFAULT_BUFBYTES; 
+    c->sockbacklog = DEFAULT_CGID_LISTENBACKLOG;
     c->sockname = ap_server_root_relative(p, DEFAULT_SOCKET); 
     return c; 
 } 
@@ -785,6 +787,16 @@
     return NULL; 
 } 
 
+static const char *set_scriptsock_backlog(cmd_parms *cmd, void *dummy, const char *arg)
+{
+    server_rec *s = cmd->server;
+    cgid_server_conf *conf = ap_get_module_config(s->module_config,
+                                                  &cgid_module);
+
+    conf->sockbacklog = atoi(arg);
+    return NULL;
+}
+
 static const command_rec cgid_cmds[] = 
 { 
     AP_INIT_TAKE1("ScriptLog", set_scriptlog, NULL, RSRC_CONF,
@@ -796,6 +808,9 @@
     AP_INIT_TAKE1("Scriptsock", set_script_socket, NULL, RSRC_CONF,
                   "the name of the socket to use for communication with "
                   "the cgi daemon."), 
+    AP_INIT_TAKE1("ScriptsockBacklog", set_scriptsock_backlog, NULL, RSRC_CONF,
+                  "the maximum length of the queue of pending connections "
+                  "for `Scriptsock`"),
     {NULL} 
 };