diff options
Diffstat (limited to 'test/functional/lua/tcp.lua')
-rw-r--r-- | test/functional/lua/tcp.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/lua/tcp.lua b/test/functional/lua/tcp.lua index 21bb0c6e7..30285c4f5 100644 --- a/test/functional/lua/tcp.lua +++ b/test/functional/lua/tcp.lua @@ -20,7 +20,7 @@ local function http_simple_tcp_async_symbol(task) local function http_read_cb(err, data, conn) logger.errx(task, 'http_read_cb: got reply: %s, error: %s, conn: %s', data, err, conn) conn:add_write(http_read_post_cb, "POST /request2 HTTP/1.1\r\n\r\n") - task:insert_result('HTTP_ASYNC_RESPONSE', 1.0, data) + task:insert_result('HTTP_ASYNC_RESPONSE', 1.0, data or err) end rspamd_tcp:request({ task = task, @@ -43,6 +43,11 @@ local function http_simple_tcp_symbol(task) port = 18080, } + if not is_ok then + task:insert_result('HTTP_SYNC_WRITE_ERROR', 1.0, connection) + logger.errx(task, 'write error: %1', connection) + end + logger.errx(task, 'connect_sync %1, %2', is_ok, tostring(connection)) is_ok, err = connection:write('GET /request_sync HTTP/1.1\r\nConnection: keep-alive\r\n\r\n') |