Mercurial > dnsbl
comparison src/dnsbl.cpp @ 123:ecd97e7eb1f0 stable-5-15
properly return error code with reject reason
author | carl |
---|---|
date | Wed, 15 Mar 2006 08:21:51 -0800 |
parents | 1d9e6c1b8872 |
children | ea6f9c812faa |
comparison
equal
deleted
inserted
replaced
122:e8971c595845 | 123:ecd97e7eb1f0 |
---|---|
993 limit = max(limit, con.get_host_limit()); | 993 limit = max(limit, con.get_host_limit()); |
994 } | 994 } |
995 } | 995 } |
996 bool rejecting = alive.empty(); // if alive is empty, we must have set msg above in acceptable_content() | 996 bool rejecting = alive.empty(); // if alive is empty, we must have set msg above in acceptable_content() |
997 if (!rejecting) { | 997 if (!rejecting) { |
998 char *msg; | 998 char *fmt; |
999 if (check_hosts(priv, random, limit, msg, host, ip)) { | 999 if (check_hosts(priv, random, limit, fmt, host, ip)) { |
1000 char adr[sizeof "255.255.255.255"]; | 1000 char adr[sizeof "255.255.255.255"]; |
1001 adr[0] = '\0'; | 1001 adr[0] = '\0'; |
1002 inet_ntop(AF_INET, (const u_char *)&ip, adr, sizeof(adr)); | 1002 inet_ntop(AF_INET, (const u_char *)&ip, adr, sizeof(adr)); |
1003 snprintf(buf, sizeof(buf), msg, host, adr); | 1003 snprintf(buf, sizeof(buf), fmt, host, adr); |
1004 msg = buf; | 1004 msg = buf; |
1005 rejecting = true; | 1005 rejecting = true; |
1006 } | 1006 } |
1007 } | 1007 } |
1008 if (!rejecting) { | 1008 if (!rejecting) { |