diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-06 19:18:40 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-06 19:18:40 +0400 |
commit | 683b90f4c6c744557f7429ce6ff77c0f7d2175e1 (patch) | |
tree | 6e5f5cfdb0070cc7387d4045e955c6226d9f225d /utils/url_extracter.c | |
parent | 56586078f92c4cf71fad46e1f4888a49749a6313 (diff) | |
download | rspamd-683b90f4c6c744557f7429ce6ff77c0f7d2175e1.tar.gz rspamd-683b90f4c6c744557f7429ce6ff77c0f7d2175e1.zip |
* Major cleanup of cmake build system
* Add initial version of statshow utility for statfiles debugging
* Add debugging for statistics
* Remove unused utilities
Diffstat (limited to 'utils/url_extracter.c')
-rw-r--r-- | utils/url_extracter.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/utils/url_extracter.c b/utils/url_extracter.c deleted file mode 100644 index 6130c51ef..000000000 --- a/utils/url_extracter.c +++ /dev/null @@ -1,73 +0,0 @@ -#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 <gmime/gmime.h> - -#include "../src/config.h" -#if !defined(HAVE_OWN_QUEUE_H) && defined(HAVE_SYS_QUEUE_H) -#include <sys/queue.h> -#endif -#ifdef HAVE_OWN_QUEUE_H -#include "../src/queue.h" -#endif - -#include "../src/main.h" -#include "../src/cfg_file.h" -#include "../src/url.h" -#include "../src/util.h" -#include "../src/message.h" - -rspamd_hash_t *counters = NULL; - -int -main (int argc, char **argv) -{ - struct worker_task task; - struct uri *url; - char *buf = NULL; - size_t pos = 0, size = 65535; - GList *cur; - - g_mem_set_vtable(glib_mem_profiler_table); - g_mime_init (0); - bzero (&task, sizeof (struct worker_task)); - task.task_pool = memory_pool_new (memory_pool_get_size ()); - - /* Preallocate buffer */ - buf = g_malloc (size); - - while (!feof (stdin)) { - *(buf + pos) = getchar (); - pos ++; - if (pos == size) { - size *= 2; - buf = g_realloc (buf, size); - } - } - - task.cfg = memory_pool_alloc0 (task.task_pool, sizeof (struct config_file)); - - task.msg = memory_pool_alloc (task.task_pool, sizeof (f_str_t)); - task.msg->begin = buf; - task.msg->len = pos; - process_message (&task); - - cur = task.urls; - while (cur) { - url = cur->data; - printf ("%s\n", struri (url)); - cur = g_list_next (cur); - } - - return 0; -} |