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