&& rec->dns_requests == 0) {
resolved = rspamd_spf_new_addr_list (rec, rec->sender_domain);
struct spf_addr *addr;
- addr = g_slice_alloc0 (sizeof (*addr));
+ addr = g_slice_alloc0 (sizeof(*addr));
addr->flags = 0;
addr->flags |= RSPAMD_SPF_FLAG_NA;
- g_ptr_array_insert(resolved->elts, 0, addr);
+ g_ptr_array_insert (resolved->elts, 0, addr);
}
-
+
if (!spf_process_txt_record (rec, resolved, reply)) {
if (rec->dns_requests == 0) {
- resolved = g_ptr_array_index (rec->resolved, 0);
+ resolved = g_ptr_array_index(rec->resolved, 0);
struct spf_addr *addr;
- addr = g_slice_alloc0 (sizeof (*addr));
+ addr = g_slice_alloc0 (sizeof(*addr));
addr->flags = 0;
addr->flags |= RSPAMD_SPF_FLAG_NA;
- g_ptr_array_insert(resolved->elts, 0, addr);
+ g_ptr_array_insert (resolved->elts, 0, addr);
}
}
}
#endif
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 40))
+void
+g_ptr_array_insert (GPtrArray *array, gint index_, gpointer data)
+{
+ g_return_if_fail (array);
+ g_return_if_fail (index_ >= -1);
+ g_return_if_fail (index_ <= (gint )array->len);
+
+ g_ptr_array_set_size (array, array->len + 1);
+
+ if (index_ < 0) {
+ index_ = array->len;
+ }
+
+ if (index_ < array->len) {
+ memmove (&(array->pdata[index_ + 1]), &(array->pdata[index_]),
+ (array->len - index_) * sizeof(gpointer));
+ }
+
+ array->pdata[index_] = data;
+}
+#endif
+
gint
rspamd_fallocate (gint fd, off_t offset, off_t len)
{
#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 32))
void g_queue_free_full (GQueue *queue, GDestroyNotify free_func);
#endif
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 40))
+void g_ptr_array_insert (GPtrArray *array, gint index_, gpointer data)
+#endif
/*
* Convert milliseconds to timeval fields