lunbound.c
/*
 * Cancel a query using the id returned from resolve_async
 */
Cancel a query using the id returned from resolve_async
Cancel a query using the id returned from resolve_async
static int lub_cancel(lua_State *L) {
	struct ub_ctx **ctx = luaL_checkudata(L, 1, "ub_ctx");
	cb_data *my_data = luaL_checkudata(L, 2, "ub_query");
	int ret = ub_cancel(*ctx, my_data->async_id);
	if(ret != 0) {
		luaL_pushfail(L);
		lua_pushstring(L, ub_strerror(ret));
		return 2;
	}
	my_data->state = cb_done;
	lua_settop(L, 2);
	lua_getuservalue(L, 1);
	lua_pushvalue(L, 2);
	lua_pushnil(L);
	lua_settable(L, 3);
	lua_pushboolean(L, 1);
	return 1;
}
static int lub_cancel ( lua_State * L ) { struct ub_ctx * * ctx = luaL_checkudata ( L , 1 , " " ) ; cb_data * my_data = luaL_checkudata ( L , 2 , " " ) ; int ret = ub_cancel ( * ctx , my_data -> async_id ) ; if ( ret != 0 ) { luaL_pushfail ( L ) ; lua_pushstring ( L , ub_strerror ( ret ) ) ; return 2 ; } my_data -> state = cb_done ; lua_settop ( L , 2 ) ; lua_getuservalue ( L , 1 ) ; lua_pushvalue ( L , 2 ) ; lua_pushnil ( L ) ; lua_settable ( L , 3 ) ; lua_pushboolean ( L , 1 ) ; return 1 ; }
Cancel a query using the id returned from resolve_async
Cancel a query using the id returned from resolve_async
/* ub_ctx.uservalue[my_data] = nil */