summaryrefslogtreecommitdiffstats
path: root/src/perl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-02-18 14:21:06 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-02-18 14:21:06 +0300
commitf98132b90959ee6640e44ebdd2cc794a0d6c4bb8 (patch)
treec47297f282b7256d9d4aa373f856b4cb339b27d9 /src/perl.c
parent2300ff734633aa85f5ef52d6310c7253ecc5b4bc (diff)
downloadrspamd-f98132b90959ee6640e44ebdd2cc794a0d6c4bb8.tar.gz
rspamd-f98132b90959ee6640e44ebdd2cc794a0d6c4bb8.zip
* Fix issue with -fPIC and DynaLoader
* Retab perl.c
Diffstat (limited to 'src/perl.c')
-rw-r--r--src/perl.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/perl.c b/src/perl.c
index eaa334d8d..08a101285 100644
--- a/src/perl.c
+++ b/src/perl.c
@@ -4,11 +4,11 @@
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY Rambler media ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -46,40 +46,40 @@ xs_init(pTHX)
/* DynaLoader is a special case */
newXS ("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);
- rspamd_task_stash = gv_stashpv("rspamd_task", TRUE);
- rspamd_cfg_stash = gv_stashpv("rspamd_config", TRUE);
+ rspamd_task_stash = gv_stashpv("rspamd_task", TRUE);
+ rspamd_cfg_stash = gv_stashpv("rspamd_config", TRUE);
}
void
init_perl_filters (struct config_file *cfg)
{
struct perl_module *module;
- char *init_func;
- size_t funclen;
+ char *init_func;
+ size_t funclen;
SV* sv;
-
+
dTHXa (perl_interpreter);
PERL_SET_CONTEXT (perl_interpreter);
- dSP;
+ dSP;
LIST_FOREACH (module, &cfg->perl_modules, next) {
if (module->path) {
require_pv (module->path);
- ENTER;
- SAVETMPS;
+ ENTER;
+ SAVETMPS;
- PUSHMARK (SP);
+ PUSHMARK (SP);
sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(cfg))), rspamd_cfg_stash));
- XPUSHs (sv);
- PUTBACK;
- /* Call module init function */
- funclen = strlen (module->path) + sizeof ("::") + sizeof (MODULE_INIT_FUNC) - 1;
- init_func = g_malloc (funclen);
- snprintf (init_func, funclen, "%s::%s", module->path, MODULE_INIT_FUNC);
- call_pv (init_func, G_DISCARD);
-
- FREETMPS;
- LEAVE;
+ XPUSHs (sv);
+ PUTBACK;
+ /* Call module init function */
+ funclen = strlen (module->path) + sizeof ("::") + sizeof (MODULE_INIT_FUNC) - 1;
+ init_func = g_malloc (funclen);
+ snprintf (init_func, funclen, "%s::%s", module->path, MODULE_INIT_FUNC);
+ call_pv (init_func, G_DISCARD);
+
+ FREETMPS;
+ LEAVE;
}
}
}
@@ -257,9 +257,9 @@ perl_call_chain_filter (const char *function, struct worker_task *task, int *mar
void perl_call_memcached_callback (memcached_ctx_t *ctx, memc_error_t error, void *data)
{
struct {
- SV *callback;
- struct worker_task *task;
- } *callback_data = data;
+ SV *callback;
+ struct worker_task *task;
+ } *callback_data = data;
SV *sv;
dTHXa (perl_interpreter);
@@ -278,8 +278,8 @@ void perl_call_memcached_callback (memcached_ctx_t *ctx, memc_error_t error, voi
call_sv (callback_data->callback, G_SCALAR);
- /* Set save point */
- callback_data->task->save.saved = 0;
+ /* Set save point */
+ callback_data->task->save.saved = 0;
process_filters (callback_data->task);
SPAGAIN;