memset(&hints,0,sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
+ if (!blocking) {
+ /* Rspamd specific: never try to resolve on non-blocking conn requests */
+ hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
+ }
/* Try with IPv6 if no IPv4 address was found. We do it in this order since
* in a Redis client you can't afford to test if you have IPv6 connectivity
end
end
+ local ip_addr = addr:get_addr()
local options = {
task = task,
callback = rspamd_redis_make_request_cb,
- host = addr:get_addr(),
+ host = ip_addr,
timeout = redis_params['timeout'],
cmd = command,
args = args
end
local ret,conn = rspamd_redis.make_request(options)
+
+ if not ret then
+ addr:fail()
+ logger.warnx(task, "cannot make redis request to: %s", tostring(ip_addr))
+ end
+
return ret,conn,addr
end
local ret,conn = rspamd_redis.make_request(options)
if not ret then
logger.errx('cannot execute redis request')
+ addr:fail()
end
return ret,conn,addr
end
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
+ rspamd_upstream_fail (up);
rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
+ rspamd_upstream_fail (up);
rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
+ rspamd_upstream_fail (up);
rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {
rspamd_inet_address_get_port (addr));
if (session->ctx == NULL) {
+ rspamd_upstream_fail (up);
rspamd_fuzzy_redis_session_dtor (session, TRUE);
if (cb) {