summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-31 19:22:33 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-31 19:22:33 +0400
commit2efbf8d0cbe6c3cc3fa97a2c80d0887a87b5a2a5 (patch)
tree7e3bf4ca1cb10b1ad3432b14ce367c905c4c11cf
parent2a8b8ce671babd92cd60fbd70be9edf97cc20603 (diff)
downloadrspamd-2efbf8d0cbe6c3cc3fa97a2c80d0887a87b5a2a5.tar.gz
rspamd-2efbf8d0cbe6c3cc3fa97a2c80d0887a87b5a2a5.zip
* Output message id in rspamc reply
-rw-r--r--src/protocol.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/protocol.c b/src/protocol.c
index 297aaa922..63b1bee5b 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -519,7 +519,7 @@ show_url_header (struct worker_task *task)
c = *(host.begin + host.len);
*(host.begin + host.len) = '\0';
debug_task ("write url: %s", host.begin);
- r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, "%s" CRLF, host.begin);
+ r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, "%s", host.begin);
*(host.begin + host.len) = c;
}
}
@@ -528,6 +528,8 @@ show_url_header (struct worker_task *task)
if (r == 0) {
return TRUE;
}
+ r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, CRLF);
+
return rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE);
}
@@ -883,8 +885,11 @@ write_check_reply (struct worker_task *task)
write_hashes_to_log (task, logbuf, cd.log_offset, cd.log_size);
msg_info ("%s", logbuf);
- if (! rspamd_dispatcher_write (task->dispatcher, CRLF, sizeof (CRLF) - 1, FALSE, TRUE)) {
- return FALSE;
+ if (task->proto_ver >= 12) {
+ r = rspamd_snprintf (outbuf, sizeof (outbuf), "Message-ID: %s" CRLF CRLF, task->message_id);
+ if (! rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE)) {
+ return FALSE;
+ }
}
task->worker->srv->stat->messages_scanned++;