aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-02-16 19:50:18 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-02-16 19:50:18 +0300
commit0fd2682e113c400af6c43da72543bd75448e5be8 (patch)
tree9466f2887983571a85f05f1865e9b4990018764e /src
parentf2774fb0fa223c998492e69d67f1cd3137c30ec6 (diff)
downloadrspamd-0fd2682e113c400af6c43da72543bd75448e5be8.tar.gz
rspamd-0fd2682e113c400af6c43da72543bd75448e5be8.zip
* Prepare to migrate to cmake (still need to write install target and working with XS implicitly)
* Move all system includes to one file where we detect availability of all that includes * Fix license misprint * Fix some issues with perl initializing
Diffstat (limited to 'src')
-rw-r--r--src/cfg_file.h10
-rw-r--r--src/cfg_file.l9
-rw-r--r--src/cfg_file.y23
-rw-r--r--src/cfg_utils.c22
-rw-r--r--src/classifiers/classifiers.c2
-rw-r--r--src/classifiers/classifiers.h5
-rw-r--r--src/classifiers/winnow.c4
-rw-r--r--src/controller.c21
-rw-r--r--src/filter.c2
-rw-r--r--src/filter.h8
-rw-r--r--src/fstring.c5
-rw-r--r--src/hash.c5
-rw-r--r--src/hash.h2
-rw-r--r--src/main.c22
-rw-r--r--src/main.h20
-rw-r--r--src/mem_pool.c48
-rw-r--r--src/mem_pool.h4
-rw-r--r--src/memcached-test.c2
-rw-r--r--src/memcached.c2
-rw-r--r--src/message.c18
-rw-r--r--src/message.h21
-rw-r--r--src/perl.c12
-rw-r--r--src/perl.h4
-rw-r--r--src/plugins/regexp.c14
-rw-r--r--src/plugins/surbl.c15
-rw-r--r--src/protocol.c6
-rw-r--r--src/statfile.c12
-rw-r--r--src/statfile.h6
-rw-r--r--src/tokenizers/osb.c2
-rw-r--r--src/tokenizers/tokenizers.c2
-rw-r--r--src/upstream.c2
-rw-r--r--src/url.c14
-rw-r--r--src/url.h10
-rw-r--r--src/util.c19
-rw-r--r--src/util.h17
-rw-r--r--src/worker.c29
36 files changed, 64 insertions, 355 deletions
diff --git a/src/cfg_file.h b/src/cfg_file.h
index a7ad3eaaf..a5d092c73 100644
--- a/src/cfg_file.h
+++ b/src/cfg_file.h
@@ -7,16 +7,6 @@
#define CFG_FILE_H
#include "config.h"
-#include <sys/types.h>
-#ifndef HAVE_OWN_QUEUE_H
-#include <sys/queue.h>
-#else
-#include "queue.h"
-#endif
-#include <netinet/in.h>
-#include <sys/un.h>
-#include <event.h>
-#include <glib.h>
#include "mem_pool.h"
#include "upstream.h"
#include "memcached.h"
diff --git a/src/cfg_file.l b/src/cfg_file.l
index 7d940099f..c7ef97d18 100644
--- a/src/cfg_file.l
+++ b/src/cfg_file.l
@@ -2,11 +2,8 @@
%x module
%{
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <syslog.h>
+
+#include "config.h"
#include "cfg_file.h"
#include "cfg_yacc.h"
@@ -95,7 +92,7 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG;
[a-zA-Z0-9.-]+:[0-9]{1,5} yylval.string=strdup(yytext); return HOSTPORT;
[a-zA-Z<][a-zA-Z@+>_-]* yylval.string=strdup(yytext); return STRING;
\/[^/\n]+\/ yylval.string=strdup(yytext); return REGEXP;
-[a-zA-Z0-9].[a-zA-Z0-9\/.-]+ yylval.string=strdup(yytext); return DOMAIN;
+[a-zA-Z0-9].[a-zA-Z0-9\/.-]+ yylval.string=strdup(yytext); return DOMAINNAME;
<incl>[ \t]* /* eat the whitespace */
<incl>[^ \t\n]+ { /* got the include file name */
if (include_stack_ptr >= MAX_INCLUDE_DEPTH) {
diff --git a/src/cfg_file.y b/src/cfg_file.y
index e842c560e..73455976d 100644
--- a/src/cfg_file.y
+++ b/src/cfg_file.y
@@ -2,20 +2,7 @@
%{
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <glib.h>
-
+#include "config.h"
#include "cfg_file.h"
#include "main.h"
#include "classifiers/classifiers.h"
@@ -45,7 +32,7 @@ struct statfile *cur_statfile = NULL;
%token ERROR STRING QUOTEDSTRING FLAG
%token FILENAME REGEXP QUOTE SEMICOLON OBRACE EBRACE COMMA EQSIGN
-%token BINDSOCK SOCKCRED DOMAIN IPADDR IPNETWORK HOSTPORT NUMBER CHECK_TIMEOUT
+%token BINDSOCK SOCKCRED DOMAINNAME IPADDR IPNETWORK HOSTPORT NUMBER CHECK_TIMEOUT
%token MAXSIZE SIZELIMIT SECONDS BEANSTALK MYSQL USER PASSWORD DATABASE
%token TEMPDIR PIDFILE SERVERS ERROR_TIME DEAD_TIME MAXERRORS CONNECT_TIMEOUT PROTOCOL RECONNECT_TIMEOUT
%token READ_SERVERS WRITE_SERVER DIRECTORY_SERVERS MAILBOX_QUERY USERS_QUERY LASTLOGIN_QUERY
@@ -64,7 +51,7 @@ struct statfile *cur_statfile = NULL;
%type <string> SOCKCRED
%type <string> IPADDR IPNETWORK
%type <string> HOSTPORT
-%type <string> DOMAIN
+%type <string> DOMAINNAME
%type <limit> SIZELIMIT
%type <flag> FLAG
%type <seconds> SECONDS
@@ -169,7 +156,7 @@ bind_cred:
| IPADDR{
$$ = $1;
}
- | DOMAIN {
+ | DOMAINNAME {
$$ = $1;
}
| HOSTPORT {
@@ -247,7 +234,7 @@ memcached_params:
memcached_hosts:
STRING
| IPADDR
- | DOMAIN
+ | DOMAINNAME
| HOSTPORT
;
memcached_error_time:
diff --git a/src/cfg_utils.c b/src/cfg_utils.c
index 4df4bcaff..df8a2265f 100644
--- a/src/cfg_utils.c
+++ b/src/cfg_utils.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,32 +22,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <syslog.h>
-#include <netdb.h>
-#include <math.h>
#include "config.h"
#include "cfg_file.h"
#include "main.h"
#include "filter.h"
#include "classifiers/classifiers.h"
-#ifndef HAVE_OWN_QUEUE_H
-#include <sys/queue.h>
-#else
-#include "queue.h"
-#endif
#define DEFAULT_SCORE 10.0
diff --git a/src/classifiers/classifiers.c b/src/classifiers/classifiers.c
index da6786795..283350972 100644
--- a/src/classifiers/classifiers.c
+++ b/src/classifiers/classifiers.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/classifiers/classifiers.h b/src/classifiers/classifiers.h
index 2a2929b7d..13a295724 100644
--- a/src/classifiers/classifiers.h
+++ b/src/classifiers/classifiers.h
@@ -1,12 +1,7 @@
#ifndef CLASSIFIERS_H
#define CLASSIFIERS_H
-#include <sys/types.h>
#include "../config.h"
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
#include "../mem_pool.h"
#include "../statfile.h"
#include "../tokenizers/tokenizers.h"
diff --git a/src/classifiers/winnow.c b/src/classifiers/winnow.c
index 494a5304a..1b3904e67 100644
--- a/src/classifiers/winnow.c
+++ b/src/classifiers/winnow.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -26,8 +26,6 @@
* Winnow classifier
*/
-#include <sys/types.h>
-#include <math.h>
#include "classifiers.h"
#define WINNOW_PROMOTION 1.23
diff --git a/src/controller.c b/src/controller.c
index 6b7a78ae9..41f8a9649 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,24 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-
-#include <netinet/in.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <netdb.h>
-
-#include <glib.h>
-
+#include "config.h"
#include "util.h"
#include "main.h"
#include "message.h"
diff --git a/src/filter.c b/src/filter.c
index 562baac6c..088ac4376 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/filter.h b/src/filter.h
index b991109f9..c0b113dbd 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -6,13 +6,7 @@
#ifndef RSPAMD_FILTER_H
#define RSPAMD_FILTER_H
-#include <sys/types.h>
-#ifndef HAVE_OWN_QUEUE_H
-#include <sys/queue.h>
-#else
-#include "queue.h"
-#endif
-#include <glib.h>
+#include "config.h"
struct worker_task;
diff --git a/src/fstring.c b/src/fstring.c
index 57f470ff7..75be14442 100644
--- a/src/fstring.c
+++ b/src/fstring.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,9 +22,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdlib.h>
-#include <string.h>
-
#include "fstring.h"
/*
diff --git a/src/hash.c b/src/hash.c
index 6b3851da3..20989474e 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,8 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <stdlib.h>
+#include "config.h"
#include "hash.h"
#define HASH_TABLE_MIN_SIZE 19
diff --git a/src/hash.h b/src/hash.h
index 4a1e973fb..024cb3851 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -7,8 +7,6 @@
#ifndef RSPAMD_HASH_H
#define RSPAMD_HASH_H
-#include <sys/types.h>
-#include <glib.h>
#include "mem_pool.h"
struct rspamd_hash_node {
diff --git a/src/main.c b/src/main.c
index 9def8513e..1a142c9f5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,24 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <sys/param.h>
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#ifdef HAVE_LIBUTIL_H
-#include <libutil.h>
-#endif
-#include <syslog.h>
-
+#include "config.h"
#include "main.h"
#include "cfg_file.h"
#include "util.h"
@@ -324,7 +307,6 @@ main (int argc, char **argv, char **env)
PERL_SET_CONTEXT (perl_interpreter);
perl_construct (perl_interpreter);
- PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_parse (perl_interpreter, xs_init, 3, args, NULL);
/* Block signals to use sigsuspend in future */
sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL);
diff --git a/src/main.h b/src/main.h
index b037ee8cd..e1244d0ba 100644
--- a/src/main.h
+++ b/src/main.h
@@ -7,23 +7,6 @@
#define RSPAMD_MAIN_H
#include "config.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifndef HAVE_OWN_QUEUE_H
-#include <sys/queue.h>
-#else
-#include "queue.h"
-#endif
-#include <sys/time.h>
-
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
-#include <event.h>
-
#include "fstring.h"
#include "mem_pool.h"
#include "statfile.h"
@@ -32,9 +15,6 @@
#include "protocol.h"
#include "filter.h"
-#include <glib.h>
-#include <gmime/gmime.h>
-
/* Default values */
#define FIXED_CONFIG_FILE "./rspamd.conf"
/* Time in seconds to exit for old worker */
diff --git a/src/mem_pool.c b/src/mem_pool.c
index 87895f87a..ecdfbb2b5 100644
--- a/src/mem_pool.c
+++ b/src/mem_pool.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,22 +22,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <glib.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <errno.h>
#include "config.h"
-#ifdef HAVE_SCHED_YIELD
-#include <sched.h>
-#endif
-
-#ifdef HAVE_NANOSLEEP
-#include <time.h>
-#endif
-
#include "mem_pool.h"
/* Sleep time for spin lock in nanoseconds */
@@ -63,7 +49,7 @@ pthread_mutex_t stat_mtx = PTHREAD_MUTEX_INITIALIZER;
#undef MEMORY_GREEDY
/* Internal statistic */
-static memory_pool_stat_t *stat = NULL;
+static memory_pool_stat_t *mem_pool_stat = NULL;
static struct _pool_chain *
pool_chain_new (size_t size)
@@ -75,7 +61,7 @@ pool_chain_new (size_t size)
chain->pos = chain->begin;
chain->next = NULL;
STAT_LOCK ();
- stat->chunks_allocated ++;
+ mem_pool_stat->chunks_allocated ++;
STAT_UNLOCK ();
return chain;
@@ -112,7 +98,7 @@ pool_chain_new_shared (size_t size)
chain->lock = 0;
chain->next = NULL;
STAT_LOCK ();
- stat->shared_chunks_allocated ++;
+ mem_pool_stat->shared_chunks_allocated ++;
STAT_UNLOCK ();
return chain;
@@ -130,16 +116,16 @@ memory_pool_new (size_t size)
memory_pool_t *new;
/* Allocate statistic structure if it is not allocated before */
- if (stat == NULL) {
+ if (mem_pool_stat == NULL) {
#if defined(HAVE_MMAP_ANON)
- stat = mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);
+ mem_pool_stat = mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);
g_assert (stat != MAP_FAILED);
#elif defined(HAVE_MMAP_ZERO)
int fd;
fd = open ("/dev/zero", O_RDWR);
g_assert (fd != -1);
- stat = mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+ mem_pool_stat = mmap (NULL, sizeof (memory_pool_stat_t), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
g_assert (chain != MAP_FAILED);
#else
# error No mmap methods are defined
@@ -184,14 +170,14 @@ memory_pool_alloc (memory_pool_t *pool, size_t size)
pool->cur_pool = new;
new->pos += size;
STAT_LOCK ();
- stat->bytes_allocated += size;
+ mem_pool_stat->bytes_allocated += size;
STAT_UNLOCK ();
return new->begin;
}
tmp = cur->pos;
cur->pos += size;
STAT_LOCK ();
- stat->bytes_allocated += size;
+ mem_pool_stat->bytes_allocated += size;
STAT_UNLOCK ();
return tmp;
}
@@ -253,14 +239,14 @@ memory_pool_alloc_shared (memory_pool_t *pool, size_t size)
cur->next = new;
new->pos += size;
STAT_LOCK ();
- stat->bytes_allocated += size;
+ mem_pool_stat->bytes_allocated += size;
STAT_UNLOCK ();
return new->begin;
}
tmp = cur->pos;
cur->pos += size;
STAT_LOCK ();
- stat->bytes_allocated += size;
+ mem_pool_stat->bytes_allocated += size;
STAT_UNLOCK ();
return tmp;
}
@@ -370,7 +356,7 @@ memory_pool_delete (memory_pool_t *pool)
g_free (tmp->begin);
g_free (tmp);
STAT_LOCK ();
- stat->chunks_freed ++;
+ mem_pool_stat->chunks_freed ++;
STAT_UNLOCK ();
}
/* Unmap shared memory */
@@ -379,7 +365,7 @@ memory_pool_delete (memory_pool_t *pool)
cur_shared = cur_shared->next;
munmap (tmp_shared, tmp_shared->len + sizeof (struct _pool_chain_shared));
STAT_LOCK ();
- stat->chunks_freed ++;
+ mem_pool_stat->chunks_freed ++;
STAT_UNLOCK ();
}
@@ -390,10 +376,10 @@ void
memory_pool_stat (memory_pool_stat_t *st)
{
if (stat) {
- st->bytes_allocated = stat->bytes_allocated;
- st->chunks_allocated = stat->chunks_allocated;
- st->shared_chunks_allocated = stat->shared_chunks_allocated;
- st->chunks_freed = stat->chunks_freed;
+ st->bytes_allocated = mem_pool_stat->bytes_allocated;
+ st->chunks_allocated = mem_pool_stat->chunks_allocated;
+ st->shared_chunks_allocated = mem_pool_stat->shared_chunks_allocated;
+ st->chunks_freed = mem_pool_stat->chunks_freed;
}
}
diff --git a/src/mem_pool.h b/src/mem_pool.h
index 719aef220..af4f3d063 100644
--- a/src/mem_pool.h
+++ b/src/mem_pool.h
@@ -12,9 +12,7 @@
#ifndef RSPAMD_MEM_POOL_H
#define RSPAMD_MEM_POOL_H
-#include <sys/types.h>
-#include <glib.h>
-
+#include "config.h"
/**
* Destructor type definition
diff --git a/src/memcached-test.c b/src/memcached-test.c
index 319e55bec..ef81cf73c 100644
--- a/src/memcached-test.c
+++ b/src/memcached-test.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/memcached.c b/src/memcached.c
index 87536f8f1..d2636f5e6 100644
--- a/src/memcached.c
+++ b/src/memcached.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/message.c b/src/message.c
index f913c2648..5c0f15cf9 100644
--- a/src/message.c
+++ b/src/message.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,21 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#include <netdb.h>
-
-#include <glib.h>
-#include <gmime/gmime.h>
-
+#include "config.h"
#include "util.h"
#include "main.h"
#include "message.h"
diff --git a/src/message.h b/src/message.h
index 6fa4ad83c..1122e7e3b 100644
--- a/src/message.h
+++ b/src/message.h
@@ -8,27 +8,6 @@
#include "config.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifndef HAVE_OWN_QUEUE_H
-#include <sys/queue.h>
-#else
-#include "queue.h"
-#endif
-#include <sys/time.h>
-
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
-#include <event.h>
-
-#include "main.h"
-
-#include <glib.h>
-#include <gmime/gmime.h>
-
struct mime_part {
GMimeContentType *type;
GByteArray *content;
diff --git a/src/perl.c b/src/perl.c
index dc7864f20..eaa334d8d 100644
--- a/src/perl.c
+++ b/src/perl.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,15 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-
-#include <glib.h>
-
+#include "config.h"
#include "url.h"
#include "main.h"
#include "perl.h"
diff --git a/src/perl.h b/src/perl.h
index 7aabe1895..af97b6f46 100644
--- a/src/perl.h
+++ b/src/perl.h
@@ -1,8 +1,8 @@
#ifndef RSPAM_PERL_H
#define RSPAM_PERL_H
-#include <sys/types.h>
-#include <glib.h>
+
+#include "config.h"
#include "memcached.h"
#include <EXTERN.h> /* from the Perl distribution */
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 2e638dc47..1ecfcb36d 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -26,18 +26,6 @@
* rspamd module that implements different regexp rules
*/
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
#include <evdns.h>
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index 37d6780a4..529fa5b09 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -26,19 +26,6 @@
* rspamd module that implements SURBL url checking
*/
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-
#include <evdns.h>
#include "../config.h"
diff --git a/src/protocol.c b/src/protocol.c
index c106b755f..92b331ac2 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,10 +22,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
#include "main.h"
#define CRLF "\r\n"
diff --git a/src/statfile.c b/src/statfile.c
index 80742311a..83d538256 100644
--- a/src/statfile.c
+++ b/src/statfile.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,17 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <time.h>
-#include <limits.h>
-#include <sys/mman.h>
#include "config.h"
-#include <string.h>
-#include <unistd.h>
-#include <glib.h>
#include "statfile.h"
#include "main.h"
diff --git a/src/statfile.h b/src/statfile.h
index 539fda842..88779ca16 100644
--- a/src/statfile.h
+++ b/src/statfile.h
@@ -7,12 +7,6 @@
#define RSPAMD_STATFILE_H
#include "config.h"
-#include <sys/types.h>
-#include <glib.h>
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
#include "mem_pool.h"
#include "hash.h"
diff --git a/src/tokenizers/osb.c b/src/tokenizers/osb.c
index 19646a1f3..a8469fc70 100644
--- a/src/tokenizers/osb.c
+++ b/src/tokenizers/osb.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/tokenizers/tokenizers.c b/src/tokenizers/tokenizers.c
index d2029a50f..48047d4fa 100644
--- a/src/tokenizers/tokenizers.c
+++ b/src/tokenizers/tokenizers.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/upstream.c b/src/upstream.c
index af99e1dfc..8bc636377 100644
--- a/src/upstream.c
+++ b/src/upstream.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
diff --git a/src/url.c b/src/url.c
index 10f639d59..09be6f112 100644
--- a/src/url.c
+++ b/src/url.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,17 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-
+#include "config.h"
#include "url.h"
#include "fstring.h"
#include "main.h"
diff --git a/src/url.h b/src/url.h
index 4964feadc..08a5cb0a6 100644
--- a/src/url.h
+++ b/src/url.h
@@ -2,17 +2,7 @@
#ifndef URL_H
#define URL_H
-#include <sys/types.h>
-#include <sys/socket.h>
#include "config.h"
-#if !defined(HAVE_OWN_QUEUE_H) && defined(HAVE_SYS_QUEUE_H)
-#include <sys/queue.h>
-#endif
-#ifdef HAVE_OWN_QUEUE_H
-#include "queue.h"
-#endif
-
-#include <glib.h>
#include "mem_pool.h"
struct worker_task;
diff --git a/src/util.c b/src/util.c
index 028bf5d4c..952c3a93e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -22,25 +22,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <sys/file.h>
-#include <syslog.h>
-#include <glib.h>
#include "config.h"
-#ifdef HAVE_LIBUTIL_H
-#include <libutil.h>
-#endif
#include "util.h"
#include "cfg_file.h"
diff --git a/src/util.h b/src/util.h
index 3036d37fd..fa5bbfbdb 100644
--- a/src/util.h
+++ b/src/util.h
@@ -1,18 +1,7 @@
-#ifndef UTIL_H
-#define UTIL_H
-
-#include <sys/types.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/queue.h>
-#include <sys/time.h>
-
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <signal.h>
+#ifndef RSPAMD_UTIL_H
+#define RSPAMD_UTIL_H
+#include "config.h"
#include "main.h"
struct config_file;
diff --git a/src/worker.c b/src/worker.c
index 7ef68dd95..caacda838 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -13,7 +13,7 @@
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
+ * DISCLAIMED. IN NO EVENT SHALL Rambler BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -26,29 +26,7 @@
* Rspamd worker implementation
*/
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-
-#include <netinet/in.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <netdb.h>
-
-#include <EXTERN.h> /* from the Perl distribution */
-#include <perl.h> /* from the Perl distribution */
-
-#include <glib.h>
-#include <event.h>
-#include <gmime/gmime.h>
-
+#include "config.h"
#include "util.h"
#include "main.h"
#include "protocol.h"
@@ -58,6 +36,9 @@
#include "modules.h"
#include "message.h"
+#include <EXTERN.h> /* from the Perl distribution */
+#include <perl.h> /* from the Perl distribution */
+
#define TASK_POOL_SIZE 4095
const f_str_t CRLF = {