changed the internal lists to hash tables

This commit is contained in:
SJ
2013-08-14 14:24:30 +02:00
parent 4f2d743f9b
commit b3cea9de7f
16 changed files with 201 additions and 164 deletions

View File

@@ -33,8 +33,9 @@ void load_mydomains(struct session_data *sdata, struct __data *data, struct __co
p_store_results(sdata, data->stmt_generic, data);
while(p_fetch_results(data->stmt_generic) == OK){
rc = append_list(&(data->mydomains), s);
if(rc == -1) syslog(LOG_PRIORITY, "failed to append mydomain: '%s'", s);
rc = addnode(data->mydomains, s);
if(rc == 0) syslog(LOG_PRIORITY, "failed to append mydomain: '%s'", s);
else if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "added mydomain: '%s'", s);
memset(s, 0, sizeof(s));
@@ -50,7 +51,6 @@ ENDE:
int is_email_address_on_my_domains(char *email, struct __data *data){
int rc=0;
char *q, *s;
struct list *p;
if(email == NULL) return rc;
@@ -61,17 +61,7 @@ int is_email_address_on_my_domains(char *email, struct __data *data){
if(s) *s = '\0';
p = data->mydomains;
while(p != NULL){
if(strcasecmp(p->s, q+1) == 0){
rc = 1;
break;
}
p = p->r;
}
if(findnode(data->mydomains, q+1)) rc = 1;
if(s) *s = ' ';