diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-02-13 23:09:53 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-02-13 23:09:53 +0300 |
commit | 1f2ccac34e77e42b47ae4dad2ba7b34690442108 (patch) | |
tree | d283b67b3fee1dd32f0b77969e4c605a05fa7aee /src | |
parent | 39e66c09606af51a877a672ba14a87ff984082ae (diff) | |
download | rspamd-1f2ccac34e77e42b47ae4dad2ba7b34690442108.tar.gz rspamd-1f2ccac34e77e42b47ae4dad2ba7b34690442108.zip |
* Remove unused field from task object
* Use separate hashes for blessing different object
Diffstat (limited to 'src')
-rw-r--r-- | src/main.h | 1 | ||||
-rw-r--r-- | src/perl.c | 20 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/main.h b/src/main.h index fb64ffed4..b037ee8cd 100644 --- a/src/main.h +++ b/src/main.h @@ -191,7 +191,6 @@ struct worker_task { f_str_buf_t *msg; /**< message buffer */ struct bufferevent *bev; /**< buffered event for IO */ memcached_ctx_t *memc_ctx; /**< memcached context associated with task */ - unsigned memc_busy:1; /**< is memcached connection is busy XXX: fix this */ int parts_count; /**< mime parts count */ GMimeMessage *message; /**< message, parsed with GMime */ GList *parts; /**< list of parsed parts */ diff --git a/src/perl.c b/src/perl.c index 607516439..2e84b4d0e 100644 --- a/src/perl.c +++ b/src/perl.c @@ -17,7 +17,8 @@ PerlInterpreter *perl_interpreter; -static HV *rspamd_stash; +static HV *rspamd_task_stash; +static HV *rspamd_cfg_stash; extern void boot_DynaLoader (pTHX_ CV* cv); extern void boot_Socket (pTHX_ CV* cv); @@ -29,7 +30,8 @@ xs_init(pTHX) /* DynaLoader is a special case */ newXS ("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__); - rspamd_stash = gv_stashpv("rspamd", TRUE); + rspamd_task_stash = gv_stashpv("rspamd_task", TRUE); + rspamd_cfg_stash = gv_stashpv("rspamd_config", TRUE); } void @@ -51,7 +53,7 @@ init_perl_filters (struct config_file *cfg) SAVETMPS; PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(cfg))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(cfg))), rspamd_cfg_stash)); XPUSHs (sv); PUTBACK; /* Call module init function */ @@ -81,7 +83,7 @@ perl_call_header_filter (const char *function, struct worker_task *task) SAVETMPS; PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_task_stash)); XPUSHs (sv); PUTBACK; @@ -113,7 +115,7 @@ perl_call_mime_filter (const char *function, struct worker_task *task) SAVETMPS; PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_task_stash)); XPUSHs (sv); PUTBACK; @@ -145,7 +147,7 @@ perl_call_message_filter (const char *function, struct worker_task *task) SAVETMPS; PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_task_stash)); XPUSHs (sv); PUTBACK; @@ -177,7 +179,7 @@ perl_call_url_filter (const char *function, struct worker_task *task) SAVETMPS; PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_task_stash)); XPUSHs (sv); PUTBACK; @@ -215,7 +217,7 @@ perl_call_chain_filter (const char *function, struct worker_task *task, int *mar av_push (av, sv_2mortal (newSViv (marks[i]))); } PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(task))), rspamd_task_stash)); XPUSHs (sv); XPUSHs (sv_2mortal ((SV *)AvARRAY (av))); PUTBACK; @@ -252,7 +254,7 @@ void perl_call_memcached_callback (memcached_ctx_t *ctx, memc_error_t error, voi ENTER; SAVETMPS; PUSHMARK (SP); - sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(callback_data->task))), rspamd_stash)); + sv = sv_2mortal (sv_bless (newRV_noinc (newSViv (PTR2IV(callback_data->task))), rspamd_task_stash)); XPUSHs (sv); XPUSHs (sv_2mortal (newSViv (error))); XPUSHs (sv_2mortal (newSVpv (ctx->param->buf, ctx->param->bufsize))); |