aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-10-06 11:52:40 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-10-06 11:52:40 +0000
commit6963ee920ab78dbaeb019576f9115aa9dade546c (patch)
tree31d9ad806029726434989b629460742a90ba7528 /src/main.c
parent9b4109b9f60ff9b4d4070067857dd42b65b76578 (diff)
downloadmailfromd-6963ee920ab78dbaeb019576f9115aa9dade546c.tar.gz
mailfromd-6963ee920ab78dbaeb019576f9115aa9dade546c.tar.bz2
(method_strict, method_standard): Set cache_used to 1 or 0 depending on whether the cached data were used or not.
git-svn-id: file:///svnroot/mailfromd/trunk@610 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 767c81db..aeb4eadb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -838,12 +838,14 @@ mf_status
method_strict(eval_environ_t env, char *email, char *client_addr,
char *ehlo, char *mailfrom)
{
- mf_status rc = cache_get2(email, client_addr);
+ mf_status rc;
if (email[0] == 0)
return mf_success;
-
+
+ rc = cache_get2(email, client_addr);
if (!mf_resolved(rc)) {
+ set_cache_used(env, 0);
rc = check_on_host(env, email, client_addr, ehlo, mailfrom);
if (!mf_resolved(rc)) {
mf_status mx_stat;
@@ -855,7 +857,8 @@ method_strict(eval_environ_t env, char *email, char *client_addr,
}
if (mf_resolved(rc))
cache_insert2(email, client_addr, rc);
- }
+ } else
+ set_cache_used(env, 1);
return rc;
}
@@ -864,12 +867,15 @@ method_strict(eval_environ_t env, char *email, char *client_addr,
mf_status
method_standard(eval_environ_t env, char *email, char *ehlo, char *mailfrom)
{
- mf_status rc = cache_get(email);
+ mf_status rc;
if (email[0] == 0)
return mf_success;
+
+ rc = cache_get(email);
if (!mf_resolved(rc)) {
char *p = strchr(email, '@');
+ set_cache_used(env, 0);
if (p == NULL) {
mu_error("Invalid address: %s", email);
rc = mf_not_found;
@@ -886,7 +892,8 @@ method_standard(eval_environ_t env, char *email, char *ehlo, char *mailfrom)
}
if (mf_resolved(rc))
cache_insert(email, rc);
- }
+ } else
+ set_cache_used(env, 1);
return rc;
}

Return to:

Send suggestions and report system problems to the System administrator.