annotate src/plugins/trash/trash-plugin.c @ 4848:967de900c73a HEAD

Mailbox list indexing and related changes. Currently works only with maildir and mmap_disable=no. This allows doing STATUS to synced mailboxes without opening their index files at all.
author Timo Sirainen <tss@iki.fi>
date Sun, 26 Nov 2006 00:17:39 +0200
parents 49c9e7588de4
children 6b0032df7008
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 /* Copyright (C) 2005 Timo Sirainen */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3 #include "lib.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include "array.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 #include "istream.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 #include "home-expand.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 #include "mail-search.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 #include "quota-private.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 #include "quota-plugin.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 #include "trash-plugin.h"
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 #include <stdlib.h>
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 #include <unistd.h>
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14 #include <fcntl.h>
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 #define MAX_RETRY_COUNT 3
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 struct trash_mailbox {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 const char *name;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 int priority; /* lower number = higher priority */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22 struct mail_storage *storage;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24 /* temporarily set while cleaning: */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 struct mailbox *box;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26 struct mailbox_transaction_context *trans;
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
27 struct mail_search_arg search_arg;
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28 struct mail_search_context *search_ctx;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29 struct mail *mail;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
31 unsigned int mail_set:1;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32 };
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
33
4514
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
34 static int (*trash_next_quota_test_alloc)(struct quota_transaction_context *,
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
35 uoff_t, bool *);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
36
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 static pool_t config_pool;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38 /* trash_boxes ordered by priority, highest first */
4451
1a35d53c18fc Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents: 4400
diff changeset
39 static ARRAY_DEFINE(trash_boxes, struct trash_mailbox);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
40
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
41 static int sync_mailbox(struct mailbox *box)
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
42 {
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
43 struct mailbox_sync_context *ctx;
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
44 struct mailbox_sync_rec sync_rec;
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
45
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
46 ctx = mailbox_sync_init(box, MAILBOX_SYNC_FLAG_FULL_READ);
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
47 while (mailbox_sync_next(ctx, &sync_rec) > 0)
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
48 ;
4848
967de900c73a Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents: 4796
diff changeset
49 return mailbox_sync_deinit(&ctx, 0, NULL);
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
50 }
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
51
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
52 static int trash_clean_mailbox_open(struct trash_mailbox *trash)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
53 {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
54 trash->box = mailbox_open(trash->storage, trash->name, NULL,
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
55 MAILBOX_OPEN_KEEP_RECENT);
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
56 if (sync_mailbox(trash->box) < 0)
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
57 return -1;
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
58
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
59 trash->trans = mailbox_transaction_begin(trash->box, 0);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
60
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
61 trash->search_ctx = mailbox_search_init(trash->trans, NULL,
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
62 &trash->search_arg, NULL);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
63 trash->mail = mail_alloc(trash->trans, MAIL_FETCH_PHYSICAL_SIZE |
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
64 MAIL_FETCH_RECEIVED_DATE, NULL);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
65
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
66 return mailbox_search_next(trash->search_ctx, trash->mail);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
67 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
68
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
69 static int trash_clean_mailbox_get_next(struct trash_mailbox *trash,
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
70 time_t *received_time_r)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
71 {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
72 int ret;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
73
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
74 if (!trash->mail_set) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
75 if (trash->box == NULL)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
76 ret = trash_clean_mailbox_open(trash);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
77 else
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
78 ret = mailbox_search_next(trash->search_ctx,
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
79 trash->mail);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80 if (ret <= 0)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
81 return ret;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
82
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
83 trash->mail_set = TRUE;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
84 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
85
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
86 *received_time_r = mail_get_received_date(trash->mail);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
87 return 1;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
88 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
89
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
90 static int trash_try_clean_mails(uint64_t size_needed)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
91 {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
92 struct trash_mailbox *trashes;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
93 unsigned int i, j, count, oldest_idx;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
94 time_t oldest, received;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
95 uint64_t size;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
96 int ret = 0;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
97
4451
1a35d53c18fc Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents: 4400
diff changeset
98 trashes = array_get_modifiable(&trash_boxes, &count);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
99 for (i = 0; i < count; ) {
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
100 if (trashes[i].storage == NULL) {
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
101 /* FIXME: this is really ugly. it'll do however until
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
102 we get proper namespace support for lib-storage. */
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
103 struct mail_storage *const *storage;
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
104
4796
49c9e7588de4 s/quota/quota_set/ so we don't conflict with the quota symbol already
Timo Sirainen <tss@iki.fi>
parents: 4748
diff changeset
105 storage = array_idx(&quota_set->storages, 0);
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
106 trashes[i].storage = *storage;
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
107 }
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
108 /* expunge oldest mails first in all trash boxes with
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
109 same priority */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
110 oldest_idx = count;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
111 oldest = (time_t)-1;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
112 for (j = i; j < count; j++) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
113 if (trashes[j].priority != trashes[j].priority)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
114 break;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
115
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
116 ret = trash_clean_mailbox_get_next(&trashes[i],
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
117 &received);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
118 if (ret < 0)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
119 goto __err;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
120 if (ret > 0) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
121 if (oldest == (time_t)-1 ||
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
122 received < oldest) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
123 oldest = received;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
124 oldest_idx = j;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
125 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
126 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
127 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
128
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
129 if (oldest_idx < count) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
130 if (mail_expunge(trashes[oldest_idx].mail) < 0)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
131 break;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
132
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
133 size = mail_get_physical_size(trashes[oldest_idx].mail);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
134 if (size >= size_needed) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
135 size_needed = 0;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
136 break;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
137 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
138 trashes[oldest_idx].mail_set = FALSE;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
139
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
140 size_needed -= size;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
141 } else {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
142 /* find more mails from next priority's mailbox */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
143 i = j;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
144 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
145 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
146
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
147 __err:
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
148 for (i = 0; i < count; i++) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
149 struct trash_mailbox *trash = &trashes[i];
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
150
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
151 trash->mail_set = FALSE;
3879
928229f8b3e6 deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
152 mail_free(&trash->mail);
928229f8b3e6 deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
153 (void)mailbox_search_deinit(&trash->search_ctx);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
154
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
155 if (size_needed == 0) {
3879
928229f8b3e6 deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
156 (void)mailbox_transaction_commit(&trash->trans,
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
157 MAILBOX_SYNC_FLAG_FULL_WRITE);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
158 } else {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
159 /* couldn't get enough space, don't expunge anything */
3879
928229f8b3e6 deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
160 mailbox_transaction_rollback(&trash->trans);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
161 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
162
3879
928229f8b3e6 deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
163 mailbox_close(&trash->box);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
164 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
165 return size_needed == 0;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
166 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
167
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
168 static int
4514
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
169 trash_quota_test_alloc(struct quota_transaction_context *ctx,
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
170 uoff_t size, bool *too_large_r)
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
171 {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
172 int ret, i;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
173
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
174 for (i = 0; ; i++) {
4514
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
175 ret = trash_next_quota_test_alloc(ctx, size, too_large_r);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
176 if (ret != 0 || *too_large_r)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
177 return ret;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
178
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
179 if (i == MAX_RETRY_COUNT) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
180 /* trash_try_clean_mails() should have returned 0 if
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
181 it couldn't get enough space, but allow retrying
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
182 it a couple of times if there was some extra space
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
183 that was needed.. */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
184 break;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
185 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
186
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
187 /* not enough space. try deleting some from mailbox. */
4514
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
188 ret = trash_try_clean_mails(size);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
189 if (ret <= 0)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
190 return 0;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
191 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
192
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
193 return 0;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
194 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
195
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
196 static int trash_mailbox_priority_cmp(const void *p1, const void *p2)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
197 {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
198 const struct trash_mailbox *t1 = p1, *t2 = p2;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
199
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
200 return t1->priority - t2->priority;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
201 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
202
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
203 static int read_configuration(const char *path)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
204 {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
205 struct istream *input;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
206 const char *line, *name;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
207 struct trash_mailbox *trash;
4602
444edc8abef9 Don't allow giving NULL parameter to array_get() or array_get_modifiable().
Timo Sirainen <tss@iki.fi>
parents: 4596
diff changeset
208 unsigned int count;
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
209 int fd;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
210
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
211 fd = open(path, O_RDONLY);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
212 if (fd == -1) {
4400
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
213 i_error("open(%s) failed: %m", path);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
214 return -1;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
215 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
216
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
217 p_clear(config_pool);
4596
bf4e98a0de3f Replaced ARRAY_CREATE() macro with [ipt]_array_init() macros. The macro
Timo Sirainen <tss@iki.fi>
parents: 4594
diff changeset
218 p_array_init(&trash_boxes, config_pool, 8);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
219
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
220 input = i_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
221 while ((line = i_stream_read_next_line(input)) != NULL) {
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
222 /* <priority> <mailbox name> */
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
223 name = strchr(line, ' ');
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
224 if (name == NULL || name[1] == '\0')
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
225 continue;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
226
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
227 trash = array_append_space(&trash_boxes);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
228 trash->name = p_strdup(config_pool, name+1);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
229 trash->priority = atoi(t_strdup_until(line, name));
4748
5fb199ed254a Trash plugin was completely broken before.
Timo Sirainen <tss@iki.fi>
parents: 4602
diff changeset
230 trash->search_arg.type = SEARCH_ALL;
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
231 }
4070
71b8faa84ec6 Added i_stream_destroy() and o_stream_destroy() and used them instead of
Timo Sirainen <tss@iki.fi>
parents: 3879
diff changeset
232 i_stream_destroy(&input);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
233 (void)close(fd);
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
234
4602
444edc8abef9 Don't allow giving NULL parameter to array_get() or array_get_modifiable().
Timo Sirainen <tss@iki.fi>
parents: 4596
diff changeset
235 trash = array_get_modifiable(&trash_boxes, &count);
444edc8abef9 Don't allow giving NULL parameter to array_get() or array_get_modifiable().
Timo Sirainen <tss@iki.fi>
parents: 4596
diff changeset
236 qsort(trash, count, sizeof(*trash), trash_mailbox_priority_cmp);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
237 return 0;
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
238 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
239
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
240 void trash_plugin_init(void)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
241 {
4400
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
242 const char *env;
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
243
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
244 env = getenv("TRASH");
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
245 if (env == NULL)
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
246 return;
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
247
4796
49c9e7588de4 s/quota/quota_set/ so we don't conflict with the quota symbol already
Timo Sirainen <tss@iki.fi>
parents: 4748
diff changeset
248 if (quota_set == NULL) {
4400
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
249 i_error("trash plugin: quota plugin not initialized");
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
250 return;
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
251 }
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
252
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
253 config_pool = pool_alloconly_create("trash config", 1024);
4400
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
254 if (read_configuration(env) < 0)
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
255 return;
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
256
4796
49c9e7588de4 s/quota/quota_set/ so we don't conflict with the quota symbol already
Timo Sirainen <tss@iki.fi>
parents: 4748
diff changeset
257 trash_next_quota_test_alloc = quota_set->test_alloc;
49c9e7588de4 s/quota/quota_set/ so we don't conflict with the quota symbol already
Timo Sirainen <tss@iki.fi>
parents: 4748
diff changeset
258 quota_set->test_alloc = trash_quota_test_alloc;
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
259 }
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
260
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
261 void trash_plugin_deinit(void)
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
262 {
4796
49c9e7588de4 s/quota/quota_set/ so we don't conflict with the quota symbol already
Timo Sirainen <tss@iki.fi>
parents: 4748
diff changeset
263 quota_set->test_alloc = trash_next_quota_test_alloc;
4514
511f1f5c76fa Changes to make trash plugin working again.
Timo Sirainen <tss@iki.fi>
parents: 4451
diff changeset
264
4400
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
265 if (config_pool != NULL)
593523f53500 Removed hardcoded trash plugin configuration paths. Added information about
Timo Sirainen <tss@iki.fi>
parents: 4084
diff changeset
266 pool_unref(config_pool);
3738
732b62dc1976 Added beginnings of plugin infrastructure. TODO: These could be optionally
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
267 }