Thank you for the suggestion, Thierry. I assumed the ~= nil test would be valid (and evaluate as false) if the value were uninitialized, but I've taken your advice.
The result is the same.
if connected == nil then
core.log(core.alert,"connect() failed with error: '" .. con_err .. "'
(connected == nil)\n");
end
Sep 1 15:51:38 localhost haproxy[25652]: connect() failed with error:
'Can't connect' (connected == nil)

