]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Correctly propagate redis timeouts to Lua
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 5 Sep 2016 12:50:12 +0000 (13:50 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 5 Sep 2016 12:50:12 +0000 (13:50 +0100)
src/lua/lua_redis.c

index 815192d27c3fb71356fe7be85e4af4adeb9097f8..203def2d0dd9aa2e9214cf2abf150c58da44d1ca 100644 (file)
@@ -412,6 +412,8 @@ lua_redis_timeout (int fd, short what, gpointer u)
                ac = sp_ud->c->ctx;
                /* Set to NULL to avoid double free in dtor */
                sp_ud->c->ctx = NULL;
+               ac->err = REDIS_ERR_IO;
+               errno = ETIMEDOUT;
                /*
                 * This will call all callbacks pending so the entire context
                 * will be destructed