aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-10 18:47:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-10 18:47:25 +0100
commitec64510fc496ca6e01576a53bb7862b7a9308cd3 (patch)
treec99976901c62e8d9bf142a3ffb6b3931e896e7ce /src/libutil/http.h
parente9e67d85ef8eddc7e38f57b8e11e9eac8ac1ac54 (diff)
downloadrspamd-ec64510fc496ca6e01576a53bb7862b7a9308cd3.tar.gz
rspamd-ec64510fc496ca6e01576a53bb7862b7a9308cd3.zip
[Fix] Fix race condition with shared memory by refcounts
Diffstat (limited to 'src/libutil/http.h')
-rw-r--r--src/libutil/http.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libutil/http.h b/src/libutil/http.h
index 1e4ffbbc0..4cbcaf5fb 100644
--- a/src/libutil/http.h
+++ b/src/libutil/http.h
@@ -196,6 +196,16 @@ void rspamd_http_connection_write_message (
struct timeval *timeout,
struct event_base *base);
+void rspamd_http_connection_write_message_shared (
+ struct rspamd_http_connection *conn,
+ struct rspamd_http_message *msg,
+ const gchar *host,
+ const gchar *mime_type,
+ gpointer ud,
+ gint fd,
+ struct timeval *timeout,
+ struct event_base *base);
+
/**
* Free connection structure
* @param conn
@@ -353,6 +363,17 @@ gboolean rspamd_http_message_remove_header (struct rspamd_http_message *msg,
void rspamd_http_message_free (struct rspamd_http_message *msg);
/**
+ * Increase refcount for shared file (if any) to prevent early memory unlinking
+ * @param msg
+ */
+void* rspamd_http_message_shmem_ref (struct rspamd_http_message *msg);
+/**
+ * Decrease external ref for shmem segment associated with a message
+ * @param msg
+ */
+void rspamd_http_message_shmem_unref (void *p);
+
+/**
* Parse HTTP date header and return it as time_t
* @param header HTTP date header
* @param len length of header