annotate src/anvil/connect-limit.h @ 22715:20415dd0b85a

dsync: Add per-mailbox sync lock that is always used. Both importing and exporting gets the lock before they even sync the mailbox. The lock is kept until the import/export finishes. This guarantees that no matter how dsync is run, two dsyncs can't be working on the same mailbox at the same time. This lock is in addition to the optional per-user lock enabled by the -l parameter. If the -l parameter is used, the same lock timeout is used for the per-mailbox lock. Otherwise 30s timeout is used. This should help to avoid email duplication when replication is enabled for public namespaces, and maybe in some other rare situations as well.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 28 Dec 2017 14:10:23 +0200
parents 1110edddec36
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9235
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 #ifndef CONNECT_LIMIT_H
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #define CONNECT_LIMIT_H
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 struct connect_limit *connect_limit_init(void);
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 void connect_limit_deinit(struct connect_limit **limit);
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 unsigned int connect_limit_lookup(struct connect_limit *limit,
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 const char *ident);
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 void connect_limit_connect(struct connect_limit *limit, pid_t pid,
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 const char *ident);
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 void connect_limit_disconnect(struct connect_limit *limit, pid_t pid,
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 const char *ident);
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 void connect_limit_disconnect_pid(struct connect_limit *limit, pid_t pid);
10145
1110edddec36 anvil: Added CONNECT-DUMP command to dump connect-limit state.
Timo Sirainen <tss@iki.fi>
parents: 9235
diff changeset
14 void connect_limit_dump(struct connect_limit *limit, struct ostream *output);
9235
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15
2e2b957f1cca Implemented anvil service, which is used to implement mail_max_userip_connections.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 #endif