[dovecot-cvs] dovecot/src/plugins/quota quota-dict.c,1.2,1.3
cras at dovecot.org
cras at dovecot.org
Sat Dec 31 00:09:06 EET 2005
- Previous message: [dovecot-cvs] dovecot/src/dict .cvsignore, NONE, 1.1 Makefile.am,
NONE, 1.1 dict-cache.c, NONE, 1.1 dict-cache.h, NONE,
1.1 dict-server.c, NONE, 1.1 dict-server.h, NONE, 1.1 main.c,
NONE, 1.1
- Next message: [dovecot-cvs] dovecot/src/lib-dict Makefile.am, 1.2,
1.3 dict-private.h, 1.1, 1.2 dict-sql.c, 1.1, 1.2 dict.c, 1.2,
1.3 dict.h, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/plugins/quota
In directory talvi:/tmp/cvs-serv32553/src/plugins/quota
Modified Files:
quota-dict.c
Log Message:
Added dictinary lookup server and a "proxy" dict implementation to talk to
it.
Index: quota-dict.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/quota/quota-dict.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- quota-dict.c 28 Dec 2005 20:17:51 -0000 1.2
+++ quota-dict.c 30 Dec 2005 22:09:04 -0000 1.3
@@ -131,22 +131,24 @@
{
struct dict_quota *quota = (struct dict_quota *)root->quota;
const char *value;
+ int ret;
if (quota->dict == NULL)
return 0;
t_push();
- value = dict_lookup(quota->dict, unsafe_data_stack_pool,
- t_strconcat(DICT_QUOTA_LIMIT_PATH, name, NULL));
+ ret = dict_lookup(quota->dict, unsafe_data_stack_pool,
+ t_strconcat(DICT_QUOTA_LIMIT_PATH, name, NULL),
+ &value);
*limit_r = value == NULL ? 0 : strtoull(value, NULL, 10);
if (value == NULL) {
/* resource doesn't exist */
*value_r = 0;
} else {
- value = dict_lookup(quota->dict, unsafe_data_stack_pool,
- t_strconcat(DICT_QUOTA_CURRENT_PATH,
- name, NULL));
+ ret = dict_lookup(quota->dict, unsafe_data_stack_pool,
+ t_strconcat(DICT_QUOTA_CURRENT_PATH,
+ name, NULL), &value);
*value_r = value == NULL ? 0 : strtoull(value, NULL, 10);
}
t_pop();
@@ -154,7 +156,7 @@
*limit_r /= 1024;
*value_r /= 1024;
- return value == NULL;
+ return ret;
}
static int
@@ -180,13 +182,13 @@
if (quota->dict != NULL) {
t_push();
- value = dict_lookup(quota->dict, unsafe_data_stack_pool,
- DICT_QUOTA_LIMIT_PATH"storage");
+ (void)dict_lookup(quota->dict, unsafe_data_stack_pool,
+ DICT_QUOTA_LIMIT_PATH"storage", &value);
ctx->storage_limit = value == NULL ? 0 :
strtoull(value, NULL, 10);
- value = dict_lookup(quota->dict, unsafe_data_stack_pool,
- DICT_QUOTA_CURRENT_PATH"storage");
+ (void)dict_lookup(quota->dict, unsafe_data_stack_pool,
+ DICT_QUOTA_CURRENT_PATH"storage", &value);
ctx->storage_current = value == NULL ? 0 :
strtoull(value, NULL, 10);
t_pop();
- Previous message: [dovecot-cvs] dovecot/src/dict .cvsignore, NONE, 1.1 Makefile.am,
NONE, 1.1 dict-cache.c, NONE, 1.1 dict-cache.h, NONE,
1.1 dict-server.c, NONE, 1.1 dict-server.h, NONE, 1.1 main.c,
NONE, 1.1
- Next message: [dovecot-cvs] dovecot/src/lib-dict Makefile.am, 1.2,
1.3 dict-private.h, 1.1, 1.2 dict-sql.c, 1.1, 1.2 dict.c, 1.2,
1.3 dict.h, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list