Bug in forward.lua. Wasn't breaking from the loop.

This commit is contained in:
Diego Nehab 2005-04-21 05:38:07 +00:00
parent 434e8e014c
commit 9596c7f95d
3 changed files with 18 additions and 12 deletions

View file

@ -213,13 +213,14 @@ static int meth_connect(lua_State *L)
unsigned short port = (unsigned short) luaL_checknumber(L, 3);
p_tm tm = tm_markstart(&tcp->tm);
const char *err = inet_tryconnect(&tcp->sock, address, port, tm);
/* have to set the class even if it failed due to non-blocking connects */
aux_setclass(L, "tcp{client}", 1);
if (err) {
lua_pushnil(L);
lua_pushstring(L, err);
return 2;
}
/* turn master object into a client object */
aux_setclass(L, "tcp{client}", 1);
lua_pushnumber(L, 1);
return 1;
}