47 lua_pushvalue(L, -2); |
46 lua_pushvalue(L, -2); |
48 lua_remove(L, -3); |
47 lua_remove(L, -3); |
49 /* func, bufferevent */ |
48 /* func, bufferevent */ |
50 lua_pushinteger(L, what); |
49 lua_pushinteger(L, what); |
51 /* What to do w/ errors...? */ |
50 /* What to do w/ errors...? */ |
52 lua_pcall(L, 2, 0, 0); |
51 if(!lua_pcall(L, 2, 0, 0)) |
|
52 { |
|
53 /* FIXME: Perhaps luaevent users should be |
|
54 * able to set an error handler? */ |
|
55 lua_pop(L, 1); /* Pop error message */ |
|
56 } |
53 } |
57 } |
54 |
58 |
55 static void buffer_event_readcb(struct bufferevent *ev, void *ptr) { |
59 static void buffer_event_readcb(struct bufferevent *ev, void *ptr) { |
56 handle_callback((le_bufferevent*)ptr, EVBUFFER_READ, 1); |
60 handle_callback((le_bufferevent*)ptr, EVBUFFER_READ, 1); |
57 } |
61 } |