0
+static VALUE waiting_clients;
0
static VALUE global_fragment;
0
static VALUE global_path_info;
0
static VALUE global_query_string;
0
@@ -65,7 +67,6 @@ static int clients_in_use_p()
0
void request_cb(ebb_client *client, void *data)
0
- VALUE waiting_clients = (VALUE)data;
0
VALUE rb_client = Data_Wrap_Struct(cClient, 0, 0, client);
0
rb_ary_push(waiting_clients, rb_client);
0
@@ -85,7 +86,7 @@ VALUE server_listen_on_port(VALUE _, VALUE port)
0
-const struct timeval idle_timeout = { tv_sec: 0, tv_usec: 50000 };
0
+static struct timeval idle_timeout = { tv_sec: 0, tv_usec: 50000 };
0
idle_cb (struct ev_loop *loop, struct ev_idle *w, int revents) {
0
@@ -144,6 +145,11 @@ VALUE server_open(VALUE _)
0
return server->open ? Qtrue : Qfalse;
0
+VALUE server_waiting_clients(VALUE _)
0
+ return waiting_clients;
0
VALUE env_field(struct ebb_env_item *item)
0
@@ -269,7 +275,7 @@ void Init_ebb_ext()
0
VALUE mEbb = rb_define_module("Ebb");
0
VALUE mFFI = rb_define_module_under(mEbb, "FFI");
0
- rb_define_const(mEbb, "VERSION", rb_str_new2(EBB_VERSION));
0
+ rb_define_const(mFFI, "VERSION", rb_str_new2(EBB_VERSION));
0
/** Defines global strings in the init method. */
0
#define DEF_GLOBAL(N, val) global_##N = rb_obj_freeze(rb_str_new2(val)); rb_global_variable(&global_##N)
0
@@ -292,6 +298,7 @@ void Init_ebb_ext()
0
rb_define_singleton_method(mFFI, "server_listen_on_port", server_listen_on_port, 1);
0
rb_define_singleton_method(mFFI, "server_unlisten", server_unlisten, 0);
0
rb_define_singleton_method(mFFI, "server_open?", server_open, 0);
0
+ rb_define_singleton_method(mFFI, "server_waiting_clients", server_waiting_clients, 0);
0
cClient = rb_define_class_under(mEbb, "Client", rb_cObject);
0
rb_define_singleton_method(mFFI, "client_read_input", client_read_input, 2);
0
@@ -308,7 +315,7 @@ void Init_ebb_ext()
0
server = ebb_server_alloc();
0
- VALUE waiting_clients = rb_ary_new();
0
+ waiting_clients = rb_ary_new();
0
rb_iv_set(mFFI, "@waiting_clients", waiting_clients);
0
ebb_server_init(server, loop, request_cb, (void*)waiting_clients);
Comments
No one has commented yet.