BUG/MEDIUM: lua: outgoing connection was broken since 1.6-dev2 (bis)

See commit id bdc97a8795c52af94683db25a4984578e26f4857

Michael Ezzell reported that the following Lua code fails in
dev4 when the TCP is not established immediately (due to a little
bit of latency):

   function tricky_socket()
        local sock = core.tcp();
        sock:settimeout(3);
        core.log(core.alert,"calling connect()\n");
        local connected, con_err = sock:connect("x.x.x.x",80);
        core.log(core.alert,"returned from connect()\n");
        if con_err ~= nil then
          core.log(core.alert,"connect() failed with error: '" .. con_err .. "'\n");
        end

The problem is that the flags who want to wake up the applet are
resetted before each applet call, so the applet must set again the
flags if the connection is not established.
1 file changed