View | Details | Raw Unified | Return to bug 204603
Collapse All | Expand All

(-)c-icap/Makefile (-6 / +4 lines)
Lines 1-12 Link Here
1
# Created by: Elisey Savateev <b3k@mail.ru>
1
# Created by: Elisey Savateev <b3k@mail.ru>
2
# $FreeBSD: head/www/c-icap/Makefile 386585 2015-05-17 07:42:33Z amdmi3 $
2
# $FreeBSD: head/www/c-icap/Makefile 373048 2014-11-22 11:35:03Z antoine $
3
3
4
PORTNAME=	c-icap
4
PORTNAME=	c-icap
5
PORTVERSION=	0.3.5
5
PORTVERSION=	0.4.2
6
PORTREVISION=	2
7
PORTEPOCH=	2
6
PORTEPOCH=	2
8
CATEGORIES=	www
7
CATEGORIES=	www
9
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/0.3.x/
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/0.4.x/
10
DISTNAME=	c_icap-${PORTVERSION}
9
DISTNAME=	c_icap-${PORTVERSION}
11
10
12
MAINTAINER=	mm@FreeBSD.org
11
MAINTAINER=	mm@FreeBSD.org
Lines 16-23 Link Here
16
15
17
GNU_CONFIGURE=	yes
16
GNU_CONFIGURE=	yes
18
INSTALL_TARGET=	install-strip
17
INSTALL_TARGET=	install-strip
19
USES=		cpe libtool
18
USES=		libtool
20
CPE_VENDOR=	c-icap_project
21
USE_LDCONFIG=	yes
19
USE_LDCONFIG=	yes
22
USE_RC_SUBR=	c-icap
20
USE_RC_SUBR=	c-icap
23
21
(-)c-icap/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (c_icap-0.3.5.tar.gz) = 46b97fab73dbb9e8def8e34c3f94048c92f50a5341bb85bec4f6f6349aec529a
1
SHA256 (c_icap-0.4.2.tar.gz) = b138c7d7d9828d54c3307bcfe7b4917911266593832ffc26a60df9a0dfd2511e
2
SIZE (c_icap-0.3.5.tar.gz) = 614388
2
SIZE (c_icap-0.4.2.tar.gz) = 642379
(-)c-icap/files/patch-aserver.c (-42 lines)
Lines 1-42 Link Here
1
--- aserver.c.orig	2014-11-21 23:14:37.959523762 +0100
2
+++ aserver.c	2014-11-21 23:15:01.595515118 +0100
3
@@ -125,9 +125,9 @@
4
      ci_txt_template_set_dir(DATADIR"templates");
5
      commands_init();
6
 
7
-     if (!(CONF.MAGIC_DB = ci_magic_db_load(CONF.magics_file))) {
8
+     if (!(CI_CONF.MAGIC_DB = ci_magic_db_load(CI_CONF.magics_file))) {
9
           ci_debug_printf(1, "Can not load magic file %s!!!\n",
10
-                          CONF.magics_file);
11
+                          CI_CONF.magics_file);
12
      }
13
      init_conf_tables();
14
      request_stats_init();
15
@@ -143,22 +143,22 @@
16
      }
17
 
18
 #if ! defined(_WIN32)
19
-     if (is_icap_running(CONF.PIDFILE)) {
20
+     if (is_icap_running(CI_CONF.PIDFILE)) {
21
           ci_debug_printf(1, "c-icap server already running!\n");
22
           exit(-1);
23
      }
24
      if (DAEMON_MODE)
25
           run_as_daemon();
26
-     if (!set_running_permissions(CONF.RUN_USER, CONF.RUN_GROUP))
27
+     if (!set_running_permissions(CI_CONF.RUN_USER, CI_CONF.RUN_GROUP))
28
           exit(-1);
29
-     store_pid(CONF.PIDFILE);
30
+     store_pid(CI_CONF.PIDFILE);
31
 #endif
32
 
33
-     if (!init_server(CONF.ADDRESS, CONF.PORT, &(CONF.PROTOCOL_FAMILY)))
34
+     if (!init_server(CI_CONF.ADDRESS, CI_CONF.PORT, &(CI_CONF.PROTOCOL_FAMILY)))
35
           return -1;
36
      post_init_modules();
37
      post_init_services();
38
      start_server();
39
-     clear_pid(CONF.PIDFILE);
40
+     clear_pid(CI_CONF.PIDFILE);
41
      return 0;
42
 }
(-)c-icap/files/patch-cfg_param.c (-183 lines)
Lines 1-183 Link Here
1
--- cfg_param.c.orig	2014-11-21 23:05:59.123552647 +0100
2
+++ cfg_param.c	2014-11-21 23:08:29.362542582 +0100
3
@@ -40,7 +40,7 @@
4
 int ARGC;
5
 char **ARGV;
6
 
7
-struct ci_server_conf CONF = {
8
+struct ci_server_conf CI_CONF = {
9
      NULL, /* LISTEN ADDRESS */ 1344, /*PORT*/ AF_INET,    /*SOCK_FAMILY */
10
 #ifdef _WIN32
11
      "c:\\TEMP", /*TMPDIR*/ "c:\\TEMP\\c-icap.pid", /*PIDFILE*/ "\\\\.\\pipe\\c-icap",  /*COMMANDS_SOCKET; */
12
@@ -134,34 +134,34 @@
13
 };
14
 
15
 static struct ci_conf_entry conf_variables[] = {
16
-     {"ListenAddress", &CONF.ADDRESS, intl_cfg_set_str, NULL},
17
-     {"PidFile", &CONF.PIDFILE, intl_cfg_set_str, NULL},
18
-     {"CommandsSocket", &CONF.COMMANDS_SOCKET, intl_cfg_set_str, NULL},
19
+     {"ListenAddress", &CI_CONF.ADDRESS, intl_cfg_set_str, NULL},
20
+     {"PidFile", &CI_CONF.PIDFILE, intl_cfg_set_str, NULL},
21
+     {"CommandsSocket", &CI_CONF.COMMANDS_SOCKET, intl_cfg_set_str, NULL},
22
      {"Timeout", (void *) (&TIMEOUT), intl_cfg_set_int, NULL},
23
      {"KeepAlive", NULL, NULL, NULL},
24
      {"MaxKeepAliveRequests", &MAX_KEEPALIVE_REQUESTS, intl_cfg_set_int, NULL},
25
      {"KeepAliveTimeout", &KEEPALIVE_TIMEOUT, intl_cfg_set_int, NULL},
26
-     {"StartServers", &CONF.START_SERVERS, intl_cfg_set_int, NULL},
27
-     {"MaxServers", &CONF.MAX_SERVERS, intl_cfg_set_int, NULL},
28
-     {"MinSpareThreads", &CONF.MIN_SPARE_THREADS, intl_cfg_set_int, NULL},
29
-     {"MaxSpareThreads", &CONF.MAX_SPARE_THREADS, intl_cfg_set_int, NULL},
30
-     {"ThreadsPerChild", &CONF.THREADS_PER_CHILD, intl_cfg_set_int, NULL},
31
+     {"StartServers", &CI_CONF.START_SERVERS, intl_cfg_set_int, NULL},
32
+     {"MaxServers", &CI_CONF.MAX_SERVERS, intl_cfg_set_int, NULL},
33
+     {"MinSpareThreads", &CI_CONF.MIN_SPARE_THREADS, intl_cfg_set_int, NULL},
34
+     {"MaxSpareThreads", &CI_CONF.MAX_SPARE_THREADS, intl_cfg_set_int, NULL},
35
+     {"ThreadsPerChild", &CI_CONF.THREADS_PER_CHILD, intl_cfg_set_int, NULL},
36
      {"MaxRequestsPerChild", &MAX_REQUESTS_PER_CHILD, intl_cfg_set_int, NULL},
37
      {"MaxRequestsReallocateMem", &MAX_REQUESTS_BEFORE_REALLOCATE_MEM,
38
       intl_cfg_set_int, NULL},
39
-     {"Port", &CONF.PORT, intl_cfg_set_int, NULL},
40
-     {"User", &CONF.RUN_USER, intl_cfg_set_str, NULL},
41
-     {"Group", &CONF.RUN_GROUP, intl_cfg_set_str, NULL},
42
-     {"ServerAdmin", &CONF.SERVER_ADMIN, intl_cfg_set_str, NULL},
43
-     {"ServerName", &CONF.SERVER_NAME, intl_cfg_set_str, NULL},
44
+     {"Port", &CI_CONF.PORT, intl_cfg_set_int, NULL},
45
+     {"User", &CI_CONF.RUN_USER, intl_cfg_set_str, NULL},
46
+     {"Group", &CI_CONF.RUN_GROUP, intl_cfg_set_str, NULL},
47
+     {"ServerAdmin", &CI_CONF.SERVER_ADMIN, intl_cfg_set_str, NULL},
48
+     {"ServerName", &CI_CONF.SERVER_NAME, intl_cfg_set_str, NULL},
49
      {"LoadMagicFile", NULL, cfg_load_magicfile, NULL},
50
      {"Logger", &default_logger, cfg_set_logger, NULL},
51
      {"ServerLog", &SERVER_LOG_FILE, intl_cfg_set_str, NULL},
52
      {"AccessLog", NULL, cfg_set_accesslog, NULL},
53
      {"LogFormat", NULL, cfg_set_logformat, NULL},
54
      {"DebugLevel", NULL, cfg_set_debug_level, NULL},   /*Set library's debug level */
55
-     {"ServicesDir", &CONF.SERVICES_DIR, intl_cfg_set_str, NULL},
56
-     {"ModulesDir", &CONF.MODULES_DIR, intl_cfg_set_str, NULL},
57
+     {"ServicesDir", &CI_CONF.SERVICES_DIR, intl_cfg_set_str, NULL},
58
+     {"ModulesDir", &CI_CONF.MODULES_DIR, intl_cfg_set_str, NULL},
59
      {"Service", NULL, cfg_load_service, NULL},
60
      {"ServiceAlias", NULL, cfg_service_alias, NULL},
61
      {"Module", NULL, cfg_load_module, NULL},
62
@@ -451,7 +451,7 @@
63
      }
64
 
65
      db_file = argv[0];
66
-     if (strcmp(CONF.magics_file, db_file) == 0) {
67
+     if (strcmp(CI_CONF.magics_file, db_file) == 0) {
68
          ci_debug_printf(2, "The db file %s is the same as default. Ignoring...\n", db_file); 
69
          return 1;
70
      }
71
@@ -461,8 +461,8 @@
72
           ci_debug_printf(1, "Can not load magic file %s!!!\n", db_file);
73
           return 0;
74
      }
75
-     if (!CONF.MAGIC_DB)
76
-	 CONF.MAGIC_DB = ndb;
77
+     if (!CI_CONF.MAGIC_DB)
78
+	 CI_CONF.MAGIC_DB = ndb;
79
 
80
      return 1;
81
 }
82
@@ -517,24 +517,24 @@
83
           return 0;
84
      }
85
 
86
-     cfg_default_value_store(&CONF.TMPDIR, &CONF.TMPDIR, sizeof(char *));
87
+     cfg_default_value_store(&CI_CONF.TMPDIR, &CI_CONF.TMPDIR, sizeof(char *));
88
      len = strlen(argv[0]);
89
 
90
-     CONF.TMPDIR = ci_cfg_alloc_mem((len + 2) * sizeof(char));
91
-     strcpy(CONF.TMPDIR, argv[0]);
92
+     CI_CONF.TMPDIR = ci_cfg_alloc_mem((len + 2) * sizeof(char));
93
+     strcpy(CI_CONF.TMPDIR, argv[0]);
94
 #ifdef _WIN32
95
-     if (CONF.TMPDIR[len] != '\\') {
96
-          CONF.TMPDIR[len] = '\\';
97
-          CONF.TMPDIR[len + 1] = '\0';
98
+     if (CI_CONF.TMPDIR[len] != '\\') {
99
+          CI_CONF.TMPDIR[len] = '\\';
100
+          CI_CONF.TMPDIR[len + 1] = '\0';
101
      }
102
 #else
103
-     if (CONF.TMPDIR[len] != '/') {
104
-          CONF.TMPDIR[len] = '/';
105
-          CONF.TMPDIR[len + 1] = '\0';
106
+     if (CI_CONF.TMPDIR[len] != '/') {
107
+          CI_CONF.TMPDIR[len] = '/';
108
+          CI_CONF.TMPDIR[len + 1] = '\0';
109
      }
110
 #endif
111
      /*Check if tmpdir exists. If no try to build it , report an error and uses the default... */
112
-     CI_TMPDIR = CONF.TMPDIR;   /*Sets the library's temporary dir to .... */
113
+     CI_TMPDIR = CI_CONF.TMPDIR;   /*Sets the library's temporary dir to .... */
114
      ci_debug_printf(2, "Setting parameter :%s=%s\n", directive, argv[0]);
115
      return 1;
116
 }
117
@@ -842,7 +842,7 @@
118
 /* #endif */
119
 
120
 static struct ci_options_entry options[] = {
121
-     {opt_pre "f", "filename", &CONF.cfg_file, ci_cfg_set_str,
122
+     {opt_pre "f", "filename", &CI_CONF.cfg_file, ci_cfg_set_str,
123
       "Specify the configuration file"},
124
      {opt_pre "N", NULL, &DAEMON_MODE, ci_cfg_disable, "Do not run as daemon"},
125
      {opt_pre "d", "level", NULL, cfg_set_debug_level_cmd,
126
@@ -864,7 +864,7 @@
127
           ci_args_usage(argv[0], options);
128
           exit(-1);
129
      }
130
-     if (!parse_file(CONF.cfg_file)) {
131
+     if (!parse_file(CI_CONF.cfg_file)) {
132
           ci_debug_printf(1, "Error opening/parsing config file\n");
133
           exit(0);
134
      }
135
@@ -883,7 +883,7 @@
136
                           "Error in command line options, while reconfiguring!\n");
137
           return 0;
138
      }
139
-     if (!parse_file(CONF.cfg_file)) {
140
+     if (!parse_file(CI_CONF.cfg_file)) {
141
           ci_debug_printf(1,
142
                           "Error opening/parsing config file, while reconfiguring!\n");
143
           return 0;
144
@@ -923,7 +923,7 @@
145
         Release other subsystems
146
      */
147
     ci_magic_db_free();
148
-    CONF.MAGIC_DB = NULL;
149
+    CI_CONF.MAGIC_DB = NULL;
150
     ci_txt_template_close();
151
 }
152
 
153
@@ -939,9 +939,9 @@
154
 
155
      ci_debug_printf(1, "All resources released. Going to reload!\n");
156
      ci_txt_template_init();
157
-     if (!(CONF.MAGIC_DB = ci_magic_db_load(CONF.magics_file))) {
158
+     if (!(CI_CONF.MAGIC_DB = ci_magic_db_load(CI_CONF.magics_file))) {
159
           ci_debug_printf(1, "Can not load magic file %s!!!\n",
160
-                          CONF.magics_file);
161
+                          CI_CONF.magics_file);
162
      }
163
      init_modules();
164
      init_services();
165
@@ -950,15 +950,15 @@
166
         - Freeing all memory and resources used by configuration parameters (is it possible???)
167
         - reopen and read config file. Now the monitor process has now the new config parameters.
168
       */
169
-     old_port = CONF.PORT;
170
+     old_port = CI_CONF.PORT;
171
      if (!reconfig())
172
 	 return 0;
173
 
174
      /*
175
         - reinit listen socket if needed
176
       */
177
-     if (old_port != CONF.PORT) {
178
-          init_server(CONF.ADDRESS, CONF.PORT, &(CONF.PROTOCOL_FAMILY));
179
+     if (old_port != CI_CONF.PORT) {
180
+          init_server(CI_CONF.ADDRESS, CI_CONF.PORT, &(CI_CONF.PROTOCOL_FAMILY));
181
      }
182
 
183
      log_open();
(-)c-icap/files/patch-include__cfg_param.h (-11 lines)
Lines 1-11 Link Here
1
--- include/cfg_param.h.orig	2014-11-21 23:04:39.814559345 +0100
2
+++ include/cfg_param.h	2014-11-21 23:05:10.489615374 +0100
3
@@ -126,7 +126,7 @@
4
 #define ALIAS_TABLE 2
5
 
6
 #ifndef CI_BUILD_LIB
7
-extern struct ci_server_conf CONF;
8
+extern struct ci_server_conf CI_CONF;
9
 
10
 struct cfg_default_value * cfg_default_value_store(void *param, void *value,int size);
11
 struct cfg_default_value * cfg_default_value_replace(void *param, void *value);
(-)c-icap/files/patch-module.c (-146 lines)
Lines 1-146 Link Here
1
--- module.c.orig	2014-11-21 23:10:30.682534594 +0100
2
+++ module.c	2014-11-21 23:13:53.911520262 +0100
3
@@ -71,7 +71,7 @@
4
      void *module = NULL;
5
      CI_DLIB_HANDLE module_handle;
6
 
7
-     module_handle = ci_module_load(module_file, CONF.MODULES_DIR);
8
+     module_handle = ci_module_load(module_file, CI_CONF.MODULES_DIR);
9
      if (!module_handle)
10
           return NULL;
11
      module = ci_module_sym(module_handle, "module");
12
@@ -146,7 +146,7 @@
13
           if (((service_handler_module_t *) module)->init_service_handler)
14
                ret =
15
                    ((service_handler_module_t *) module)->
16
-                   init_service_handler(&CONF);
17
+                   init_service_handler(&CI_CONF);
18
           if (((service_handler_module_t *) module)->conf_table)
19
                register_conf_table(((service_handler_module_t *) module)->name,
20
                                    ((service_handler_module_t *) module)->
21
@@ -154,7 +154,7 @@
22
           break;
23
      case LOGGER:
24
           if (((logger_module_t *) module)->init_logger)
25
-               ret = ((logger_module_t *) module)->init_logger(&CONF);
26
+               ret = ((logger_module_t *) module)->init_logger(&CI_CONF);
27
           if (((logger_module_t *) module)->conf_table)
28
                register_conf_table(((logger_module_t *) module)->name,
29
                                    ((logger_module_t *) module)->conf_table,
30
@@ -165,7 +165,7 @@
31
           if (((access_control_module_t *) module)->init_access_controller)
32
                ret =
33
                    ((access_control_module_t *) module)->
34
-                   init_access_controller(&CONF);
35
+                   init_access_controller(&CI_CONF);
36
           if (((access_control_module_t *) module)->conf_table)
37
                register_conf_table(((access_control_module_t *) module)->name,
38
                                    ((access_control_module_t *) module)->
39
@@ -173,7 +173,7 @@
40
           break;
41
      case AUTH_METHOD:
42
           if (((http_auth_method_t *) module)->init_auth_method)
43
-               ret = ((http_auth_method_t *) module)->init_auth_method(&CONF);
44
+               ret = ((http_auth_method_t *) module)->init_auth_method(&CI_CONF);
45
           if (((http_auth_method_t *) module)->conf_table)
46
                register_conf_table(((http_auth_method_t *) module)->name,
47
                                    ((http_auth_method_t *) module)->conf_table,
48
@@ -184,7 +184,7 @@
49
           if (((authenticator_module_t *) module)->init_authenticator)
50
                ret =
51
                    ((authenticator_module_t *) module)->
52
-                   init_authenticator(&CONF);
53
+                   init_authenticator(&CI_CONF);
54
           if (((authenticator_module_t *) module)->conf_table)
55
                register_conf_table(((authenticator_module_t *) module)->name,
56
                                    ((authenticator_module_t *) module)->
57
@@ -192,7 +192,7 @@
58
           break;
59
      case COMMON:
60
           if (((common_module_t *) module)->init_module)
61
-               ret = ((common_module_t *) module)->init_module(&CONF);
62
+               ret = ((common_module_t *) module)->init_module(&CI_CONF);
63
           if (((common_module_t *) module)->conf_table)
64
                register_conf_table(((common_module_t *) module)->name,
65
                                    ((common_module_t *) module)->conf_table,
66
@@ -607,7 +607,7 @@
67
           if (((common_module_t *) common_modules.modules[i])->
68
               post_init_module != NULL)
69
                ((common_module_t *) common_modules.modules[i])->
70
-                   post_init_module(&CONF);
71
+                   post_init_module(&CI_CONF);
72
      }     
73
 
74
 /*     service_handlers */
75
@@ -615,7 +615,7 @@
76
           if (((service_handler_module_t *) service_handlers.modules[i])->
77
               post_init_service_handler != NULL)
78
                ((service_handler_module_t *) service_handlers.modules[i])->
79
-                   post_init_service_handler(&CONF);
80
+                   post_init_service_handler(&CI_CONF);
81
      }
82
 
83
 /*     loggers? loggers do not have post init handlers .... */
84
@@ -626,7 +626,7 @@
85
           if (((access_control_module_t *) access_controllers.modules[i])->
86
               post_init_access_controller != NULL)
87
                ((access_control_module_t *) access_controllers.modules[i])->
88
-                   post_init_access_controller(&CONF);
89
+                   post_init_access_controller(&CI_CONF);
90
      }
91
 
92
 
93
@@ -636,7 +636,7 @@
94
           if (((http_auth_method_t *) auth_methods.modules[i])->
95
               post_init_auth_method != NULL)
96
                ((http_auth_method_t *) auth_methods.modules[i])->
97
-                   post_init_auth_method(&CONF);
98
+                   post_init_auth_method(&CI_CONF);
99
      }
100
 
101
 /*     authenticators */
102
@@ -644,7 +644,7 @@
103
           if (((authenticator_module_t *) authenticators.modules[i])->
104
               post_init_authenticator != NULL)
105
                ((authenticator_module_t *) authenticators.modules[i])->
106
-                   post_init_authenticator(&CONF);
107
+                   post_init_authenticator(&CI_CONF);
108
      }
109
 
110
      return 1;
111
@@ -684,7 +684,7 @@
112
           if (((access_control_module_t *) access_controllers.modules[i])->
113
               release_access_controller != NULL)
114
                ((access_control_module_t *) access_controllers.modules[i])->
115
-                   release_access_controller(&CONF);
116
+                   release_access_controller(&CI_CONF);
117
      }
118
      RELEASE_MOD_LIST(access_controllers);
119
 
120
@@ -693,7 +693,7 @@
121
           if (((http_auth_method_t *) auth_methods.modules[i])->
122
               close_auth_method != NULL)
123
                ((http_auth_method_t *) auth_methods.modules[i])->
124
-                   close_auth_method(&CONF);
125
+                   close_auth_method(&CI_CONF);
126
      }
127
      RELEASE_MOD_LIST(auth_methods);
128
 
129
@@ -702,7 +702,7 @@
130
           if (((authenticator_module_t *) authenticators.modules[i])->
131
               close_authenticator != NULL)
132
                ((authenticator_module_t *) authenticators.modules[i])->
133
-                   close_authenticator(&CONF);
134
+                   close_authenticator(&CI_CONF);
135
      }
136
      RELEASE_MOD_LIST(authenticators);
137
 
138
@@ -711,7 +711,7 @@
139
           if (((common_module_t *) common_modules.modules[i])->
140
               close_module != NULL)
141
                ((common_module_t *) common_modules.modules[i])->
142
-                   close_module(&CONF);
143
+                   close_module(&CI_CONF);
144
      }
145
      RELEASE_MOD_LIST(common_modules);
146
 
(-)c-icap/files/patch-mpmt_server.c (-178 lines)
Lines 1-178 Link Here
1
--- mpmt_server.c.orig	2014-11-21 23:11:15.384531606 +0100
2
+++ mpmt_server.c	2014-11-21 23:11:47.359529681 +0100
3
@@ -49,7 +49,7 @@
4
 extern int MAX_SECS_TO_LINGER;
5
 extern int MAX_REQUESTS_BEFORE_REALLOCATE_MEM;
6
 extern int MAX_REQUESTS_PER_CHILD;
7
-extern struct ci_server_conf CONF;
8
+extern struct ci_server_conf CI_CONF;
9
 
10
 typedef struct server_decl {
11
      int srv_id;
12
@@ -232,13 +232,13 @@
13
      ci_thread_cond_broadcast(&(con_queue->queue_cond));
14
      /*wait for a milisecond*/
15
      ci_usleep(1000);
16
-     servers_running = CONF.THREADS_PER_CHILD;
17
+     servers_running = CI_CONF.THREADS_PER_CHILD;
18
      while (servers_running && wait_for_workers >= 0) {
19
          /*child_data->to_be_killed, may change while we are inside this loop*/
20
          if (child_data->to_be_killed == IMMEDIATELY) {
21
              CHILD_HALT = 1;
22
          }
23
-         for (i=0; i<CONF.THREADS_PER_CHILD; i++) {
24
+         for (i=0; i<CI_CONF.THREADS_PER_CHILD; i++) {
25
              if (threads_list[i] != NULL) { /* if the i thread is still alive*/
26
                  if (!threads_list[i]->running) { /*if the i thread is not running any more*/
27
                      ci_debug_printf(5, "Cancel server %d, thread_id %lu (%d)\n",
28
@@ -257,7 +257,7 @@
29
                      }
30
                  }
31
              }/*the i thread is still alive*/
32
-         } /* for(i=0;i< CONF.THREADS_PER_CHILD;i++)*/
33
+         } /* for(i=0;i< CI_CONF.THREADS_PER_CHILD;i++)*/
34
 
35
          /*wait for 1 second for the next round*/
36
          ci_usleep(999999);
37
@@ -411,7 +411,7 @@
38
       */
39
      old_childs_queue = childs_queue;
40
      childs_queue = malloc(sizeof(struct childs_queue));
41
-     if (!create_childs_queue(childs_queue, 2 * CONF.MAX_SERVERS)) {
42
+     if (!create_childs_queue(childs_queue, 2 * CI_CONF.MAX_SERVERS)) {
43
           ci_debug_printf(1,
44
                           "Cannot init shared memory. Fatal error, exiting!\n");
45
           return 0;              /*It is not enough. We must wait all childs to exit ..... */
46
@@ -419,10 +419,10 @@
47
      /*
48
         Start new childs to handle new requests.
49
       */
50
-     if (CONF.START_SERVERS > CONF.MAX_SERVERS)
51
-          CONF.START_SERVERS = CONF.MAX_SERVERS;
52
+     if (CI_CONF.START_SERVERS > CI_CONF.MAX_SERVERS)
53
+          CI_CONF.START_SERVERS = CI_CONF.MAX_SERVERS;
54
 
55
-     for (i = 0; i < CONF.START_SERVERS; i++) {
56
+     for (i = 0; i < CI_CONF.START_SERVERS; i++) {
57
           start_child(LISTEN_SOCKET);
58
      }
59
 
60
@@ -851,11 +851,11 @@
61
      ci_stat_attach_mem(child_data->stats, child_data->stats_size, NULL);
62
 
63
      threads_list =
64
-         (server_decl_t **) malloc((CONF.THREADS_PER_CHILD + 1) *
65
+         (server_decl_t **) malloc((CI_CONF.THREADS_PER_CHILD + 1) *
66
                                    sizeof(server_decl_t *));
67
-     con_queue = init_queue(CONF.THREADS_PER_CHILD);
68
+     con_queue = init_queue(CI_CONF.THREADS_PER_CHILD);
69
 
70
-     for (i = 0; i < CONF.THREADS_PER_CHILD; i++) {
71
+     for (i = 0; i < CI_CONF.THREADS_PER_CHILD; i++) {
72
           if ((threads_list[i] = newthread(con_queue)) == NULL) {
73
                exit(-1);        // FATAL error.....
74
           }
75
@@ -864,7 +864,7 @@
76
                                (void *) threads_list[i]);
77
           threads_list[i]->srv_pthread = thread;
78
      }
79
-     threads_list[CONF.THREADS_PER_CHILD] = NULL;
80
+     threads_list[CI_CONF.THREADS_PER_CHILD] = NULL;
81
      /*Now start the listener thread.... */
82
      ret = ci_thread_create(&thread, (void *(*)(void *)) listener_thread,
83
                             (void *) &sockfd);
84
@@ -957,7 +957,7 @@
85
           MY_PROC_PID = getpid();
86
           attach_childs_queue(childs_queue);
87
           child_data =
88
-              register_child(childs_queue, getpid(), CONF.THREADS_PER_CHILD, pfd[1]);
89
+              register_child(childs_queue, getpid(), CI_CONF.THREADS_PER_CHILD, pfd[1]);
90
           close(pfd[1]);
91
           child_main(fd, pfd[0]);
92
           exit(0);
93
@@ -1026,11 +1026,11 @@
94
      char command_buffer[COMMANDS_BUFFER_SIZE];
95
      int user_informed = 0;
96
 
97
-     ctl_socket = ci_named_pipe_create(CONF.COMMANDS_SOCKET);
98
+     ctl_socket = ci_named_pipe_create(CI_CONF.COMMANDS_SOCKET);
99
      if (ctl_socket < 0) {
100
           ci_debug_printf(1,
101
                           "Error opening control socket %s. Fatal error, exiting!\n",
102
-                          CONF.COMMANDS_SOCKET);
103
+                          CI_CONF.COMMANDS_SOCKET);
104
           exit(0);
105
      }
106
 
107
@@ -1040,7 +1040,7 @@
108
           exit(0);
109
      }
110
      childs_queue = malloc(sizeof(struct childs_queue));
111
-     if (!create_childs_queue(childs_queue, 2 * CONF.MAX_SERVERS)) {
112
+     if (!create_childs_queue(childs_queue, 2 * CI_CONF.MAX_SERVERS)) {
113
           ci_proc_mutex_destroy(&accept_mutex);
114
           ci_debug_printf(1,
115
                           "Can't init shared memory. Fatal error, exiting!\n");
116
@@ -1050,10 +1050,10 @@
117
      init_commands();
118
      pid = 1;
119
 #ifdef MULTICHILD
120
-     if (CONF.START_SERVERS > CONF.MAX_SERVERS)
121
-          CONF.START_SERVERS = CONF.MAX_SERVERS;
122
+     if (CI_CONF.START_SERVERS > CI_CONF.MAX_SERVERS)
123
+          CI_CONF.START_SERVERS = CI_CONF.MAX_SERVERS;
124
 
125
-     for (i = 0; i < CONF.START_SERVERS; i++) {
126
+     for (i = 0; i < CI_CONF.START_SERVERS; i++) {
127
           if (pid)
128
                pid = start_child(LISTEN_SOCKET);
129
      }
130
@@ -1068,7 +1068,7 @@
131
                }
132
                if (ret < 0) {  /*Eof received on pipe. Going to reopen ... */
133
                     ci_named_pipe_close(ctl_socket);
134
-                    ctl_socket = ci_named_pipe_open(CONF.COMMANDS_SOCKET);
135
+                    ctl_socket = ci_named_pipe_open(CI_CONF.COMMANDS_SOCKET);
136
                     if (ctl_socket < 0) {
137
                          ci_debug_printf(1,
138
                                          "Error opening control socket. We are unstable and going down!");
139
@@ -1100,16 +1100,16 @@
140
                     kill(childs_queue->childs[child_indx].pid, SIGTERM);
141
 
142
                }
143
-               else if ((freeservers <= CONF.MIN_SPARE_THREADS && childs < CONF.MAX_SERVERS)
144
-                        || childs < CONF.START_SERVERS) {
145
+               else if ((freeservers <= CI_CONF.MIN_SPARE_THREADS && childs < CI_CONF.MAX_SERVERS)
146
+                        || childs < CI_CONF.START_SERVERS) {
147
                     ci_debug_printf(8,
148
                                     "Free Servers: %d, children: %d. Going to start a child .....\n",
149
                                     freeservers, childs);
150
                     pid = start_child(LISTEN_SOCKET);
151
                }
152
-               else if (freeservers >= CONF.MAX_SPARE_THREADS &&
153
-                        childs > CONF.START_SERVERS &&
154
-                        (freeservers - CONF.THREADS_PER_CHILD) > CONF.MIN_SPARE_THREADS) {
155
+               else if (freeservers >= CI_CONF.MAX_SPARE_THREADS &&
156
+                        childs > CI_CONF.START_SERVERS &&
157
+                        (freeservers - CI_CONF.THREADS_PER_CHILD) > CI_CONF.MIN_SPARE_THREADS) {
158
 
159
                     if ((child_indx = find_an_idle_child(childs_queue)) >= 0) {
160
                          childs_queue->childs[child_indx].father_said =
161
@@ -1124,7 +1124,7 @@
162
 			 user_informed = 0;
163
                     }
164
                }
165
-               else if (childs == CONF.MAX_SERVERS && freeservers < CONF.MIN_SPARE_THREADS) {
166
+               else if (childs == CI_CONF.MAX_SERVERS && freeservers < CI_CONF.MIN_SPARE_THREADS) {
167
 		 if(! user_informed) {
168
 		         ci_debug_printf(1,
169
 					 "ATTENTION!!!! Not enough available servers (children %d, free servers %d, used servers %d)!!!!! "
170
@@ -1155,7 +1155,7 @@
171
 #else
172
      child_data = (child_shared_data_t *) malloc(sizeof(child_shared_data_t));
173
      child_data->pid = 0;
174
-     child_data->freeservers = CONF.THREADS_PER_CHILD;
175
+     child_data->freeservers = CI_CONF.THREADS_PER_CHILD;
176
      child_data->usedservers = 0;
177
      child_data->requests = 0;
178
      child_data->connections = 0;
(-)c-icap/files/patch-service.c (-29 lines)
Lines 1-29 Link Here
1
--- service.c.orig	2014-11-21 23:12:01.548529197 +0100
2
+++ service.c	2014-11-21 23:15:36.951514636 +0100
3
@@ -368,7 +368,7 @@
4
      xdata = &service_extra_data_list[services_num];
5
      init_extra_data(xdata, service->mod_name);
6
      if (service->mod_init_service) {
7
-          ret = service->mod_init_service(xdata, &CONF);
8
+          ret = service->mod_init_service(xdata, &CI_CONF);
9
           if (ret != CI_OK)
10
                xdata->status = CI_SERVICE_ERROR;
11
           else
12
@@ -449,7 +449,7 @@
13
                xdata = &service_extra_data_list[i];
14
                if ( xdata->status == CI_SERVICE_OK) {
15
                     ret = service_list[i]->
16
-                        mod_post_init_service(xdata, &CONF);
17
+                        mod_post_init_service(xdata, &CI_CONF);
18
                     if (ret != CI_OK)
19
                         xdata->status = CI_SERVICE_ERROR;
20
                }
21
@@ -608,7 +608,7 @@
22
      ci_service_module_t *service = NULL;
23
      CI_DLIB_HANDLE service_handle;
24
 
25
-     service_handle = ci_module_load(service_file, CONF.SERVICES_DIR);
26
+     service_handle = ci_module_load(service_file, CI_CONF.SERVICES_DIR);
27
      if (!service_handle)
28
           return NULL;
29
      service = ci_module_sym(service_handle, "service");
(-)c-icap/pkg-plist (-45 / +46 lines)
Lines 2-54 Link Here
2
bin/c-icap-client
2
bin/c-icap-client
3
bin/c-icap-config
3
bin/c-icap-config
4
bin/c-icap-libicapapi-config
4
bin/c-icap-libicapapi-config
5
%%BDB%%bin/c-icap-mkbdb
6
bin/c-icap-stretch
5
bin/c-icap-stretch
7
@sample etc/c-icap/c-icap.conf.sample
6
%%ETCDIR%%/c-icap.conf
8
@sample etc/c-icap/c-icap.magic.sample
7
%%ETCDIR%%/c-icap.conf.sample
9
include/c_icap/access.h
8
%%ETCDIR%%/c-icap.magic
10
include/c_icap/acl.h
9
%%ETCDIR%%/c-icap.magic.sample
11
include/c_icap/array.h
10
etc/rc.d/c-icap
12
include/c_icap/body.h
11
include/%%CICAP_USER%%/access.h
13
include/c_icap/c-icap-conf.h
12
include/%%CICAP_USER%%/acl.h
14
include/c_icap/c-icap.h
13
include/%%CICAP_USER%%/array.h
15
include/c_icap/cache.h
14
include/%%CICAP_USER%%/body.h
16
include/c_icap/cfg_param.h
15
include/%%CICAP_USER%%/c-icap-conf.h
17
include/c_icap/ci_threads.h
16
include/%%CICAP_USER%%/c-icap.h
18
include/c_icap/commands.h
17
include/%%CICAP_USER%%/cache.h
19
include/c_icap/debug.h
18
include/%%CICAP_USER%%/cfg_param.h
20
include/c_icap/dlib.h
19
include/%%CICAP_USER%%/ci_regex.h
21
include/c_icap/filetype.h
20
include/%%CICAP_USER%%/ci_threads.h
22
include/c_icap/hash.h
21
include/%%CICAP_USER%%/commands.h
23
include/c_icap/header.h
22
include/%%CICAP_USER%%/debug.h
24
include/c_icap/log.h
23
include/%%CICAP_USER%%/dlib.h
25
include/c_icap/lookup_table.h
24
include/%%CICAP_USER%%/filetype.h
26
include/c_icap/md5.h
25
include/%%CICAP_USER%%/hash.h
27
include/c_icap/mem.h
26
include/%%CICAP_USER%%/header.h
28
include/c_icap/module.h
27
include/%%CICAP_USER%%/log.h
29
include/c_icap/net_io.h
28
include/%%CICAP_USER%%/lookup_table.h
30
include/c_icap/proc_mutex.h
29
include/%%CICAP_USER%%/md5.h
31
include/c_icap/proc_threads_queues.h
30
include/%%CICAP_USER%%/mem.h
32
include/c_icap/registry.h
31
include/%%CICAP_USER%%/module.h
33
include/c_icap/request.h
32
include/%%CICAP_USER%%/net_io.h
34
include/c_icap/service.h
33
include/%%CICAP_USER%%/proc_mutex.h
35
include/c_icap/shared_mem.h
34
include/%%CICAP_USER%%/proc_threads_queues.h
36
include/c_icap/simple_api.h
35
include/%%CICAP_USER%%/registry.h
37
include/c_icap/stats.h
36
include/%%CICAP_USER%%/request.h
38
include/c_icap/txtTemplate.h
37
include/%%CICAP_USER%%/service.h
39
include/c_icap/txt_format.h
38
include/%%CICAP_USER%%/shared_mem.h
40
include/c_icap/types_ops.h
39
include/%%CICAP_USER%%/simple_api.h
41
include/c_icap/util.h
40
include/%%CICAP_USER%%/stats.h
42
%%BDB%%lib/c_icap/bdb_tables.so
41
include/%%CICAP_USER%%/txtTemplate.h
43
lib/c_icap/dnsbl_tables.so
42
include/%%CICAP_USER%%/txt_format.h
44
%%LDAP%%lib/c_icap/ldap_module.so
43
include/%%CICAP_USER%%/types_ops.h
45
%%PERL%%lib/c_icap/perl_handler.so
44
include/%%CICAP_USER%%/util.h
46
lib/c_icap/srv_echo.so
45
lib/%%CICAP_USER%%/dnsbl_tables.so
47
lib/c_icap/srv_ex206.so
46
lib/%%CICAP_USER%%/shared_cache.so
48
lib/c_icap/sys_logger.so
47
lib/%%CICAP_USER%%/srv_echo.so
48
lib/%%CICAP_USER%%/srv_ex206.so
49
lib/%%CICAP_USER%%/sys_logger.so
49
lib/libicapapi.so
50
lib/libicapapi.so
50
lib/libicapapi.so.3
51
lib/libicapapi.so.4
51
lib/libicapapi.so.3.0.5
52
lib/libicapapi.so.4.0.2
52
man/man8/c-icap-client.8.gz
53
man/man8/c-icap-client.8.gz
53
man/man8/c-icap-config.8.gz
54
man/man8/c-icap-config.8.gz
54
man/man8/c-icap-libicapapi-config.8.gz
55
man/man8/c-icap-libicapapi-config.8.gz

Return to bug 204603