aboutsummaryrefslogtreecommitdiffstats
path: root/src/lmtp_proto.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-07-02 15:51:16 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-07-02 15:51:16 +0400
commit59ecc76a83abd9d57e2c808f34d4d27568eeed33 (patch)
tree5a670c41f2ddc3766c6c2256a0128988ce54695e /src/lmtp_proto.c
parent3123a6a1d6f18c31801b30e523aec9553be31177 (diff)
downloadrspamd-59ecc76a83abd9d57e2c808f34d4d27568eeed33.tar.gz
rspamd-59ecc76a83abd9d57e2c808f34d4d27568eeed33.zip
* Add urls output to urls command
* Improve performance of dispatcher by avoiding double allocating and copying of dynamic buffers
Diffstat (limited to 'src/lmtp_proto.c')
-rw-r--r--src/lmtp_proto.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lmtp_proto.c b/src/lmtp_proto.c
index e6e09a825..69f343aaf 100644
--- a/src/lmtp_proto.c
+++ b/src/lmtp_proto.c
@@ -96,7 +96,7 @@ out_lmtp_reply (struct worker_task *task, int code, char *rcode, char *msg)
else {
r = snprintf (outbuf, OUTBUFSIZ, "%d %s %s\r\n", code, rcode, msg);
}
- rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE);
+ rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE);
}
int
@@ -337,7 +337,7 @@ mta_read_socket (f_str_t *in, void *arg)
else {
r = snprintf (outbuf, sizeof (outbuf), "HELO %s" CRLF, hostbuf);
}
- rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE);
+ rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE, FALSE);
cd->state = LMTP_WANT_MAIL;
break;
case LMTP_WANT_MAIL:
@@ -347,7 +347,7 @@ mta_read_socket (f_str_t *in, void *arg)
return;
}
r = snprintf (outbuf, sizeof (outbuf), "MAIL FROM: <%s>" CRLF, cd->task->from);
- rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE);
+ rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE, FALSE);
cd->state = LMTP_WANT_RCPT;
break;
case LMTP_WANT_RCPT:
@@ -363,7 +363,7 @@ mta_read_socket (f_str_t *in, void *arg)
cur = g_list_next (cur);
}
- rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE);
+ rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE, FALSE);
cd->state = LMTP_WANT_DATA;
break;
case LMTP_WANT_DATA:
@@ -373,7 +373,7 @@ mta_read_socket (f_str_t *in, void *arg)
return;
}
r = snprintf (outbuf, sizeof (outbuf), "DATA" CRLF);
- rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE);
+ rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE, FALSE);
cd->state = LMTP_WANT_DOT;
break;
case LMTP_WANT_DOT:
@@ -384,10 +384,10 @@ mta_read_socket (f_str_t *in, void *arg)
}
c = g_mime_object_to_string ((GMimeObject *)cd->task->message);
r = strlen (c);
- rspamd_dispatcher_write (cd->task->dispatcher, c, r, TRUE);
- g_free (c);
+ rspamd_dispatcher_write (cd->task->dispatcher, c, r, TRUE, TRUE);
+ memory_pool_add_destructor (cd->task->task_pool, (pool_destruct_func)g_free, c);
r = snprintf (outbuf, sizeof (outbuf), CRLF "." CRLF);
- rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE);
+ rspamd_dispatcher_write (cd->task->dispatcher, outbuf, r, FALSE, FALSE);
cd->state = LMTP_WANT_CLOSING;
case LMTP_WANT_CLOSING:
if (!parse_mta_str (in, cd)) {