diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-22 12:49:15 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-22 12:49:15 +0000 |
commit | 55efc237a33323d311bbc48240b495d2a54b3b03 (patch) | |
tree | 82eeb69c492c3ba05a911d4e9e1a0a6f87c479a4 /src/plugins/fuzzy_check.c | |
parent | fd1071c5a9e18537b9e7ed513858be932941630e (diff) | |
download | rspamd-55efc237a33323d311bbc48240b495d2a54b3b03.tar.gz rspamd-55efc237a33323d311bbc48240b495d2a54b3b03.zip |
Add abstract command sending function.
Diffstat (limited to 'src/plugins/fuzzy_check.c')
-rw-r--r-- | src/plugins/fuzzy_check.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index d40cc3b5a..e2ef52d4b 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -500,7 +500,7 @@ fuzzy_io_fin (void *ud) /* * Create fuzzy command from a text part */ -struct rspamd_fuzzy_cmd * +static struct rspamd_fuzzy_cmd * fuzzy_cmd_from_text_part (struct fuzzy_rule *rule, int c, gint flag, @@ -563,7 +563,7 @@ fuzzy_cmd_from_text_part (struct fuzzy_rule *rule, return cmd; } -struct rspamd_fuzzy_cmd * +static struct rspamd_fuzzy_cmd * fuzzy_cmd_from_data_part (struct fuzzy_rule *rule, int c, gint flag, @@ -608,6 +608,21 @@ fuzzy_cmd_from_data_part (struct fuzzy_rule *rule, return cmd; } +static gboolean +fuzzy_cmd_to_wire (gint fd, const struct rspamd_fuzzy_cmd *cmd, gsize len) +{ + const guchar *out = (const guchar *)cmd; + + while (write (fd, out, len) == -1) { + if (errno == EINTR) { + continue; + } + return FALSE; + } + + return TRUE; +} + /* Call this whenever we got data from fuzzy storage */ static void fuzzy_io_callback (gint fd, short what, void *arg) |