0
-static VALUE eParserError;
0
static VALUE global_http_prefix;
0
static VALUE global_request_method;
0
static VALUE global_request_uri;
0
@@ -26,15 +24,17 @@ static VALUE global_path_info;
0
static VALUE global_content_length;
0
static VALUE global_http_host;
0
+/* Variables with a leading underscore are C-level variables */
0
#define ASCII_UPPER(ch) ('a' <= ch && ch <= 'z' ? ch - 'a' + 'A' : ch)
0
VALUE client_new(ebb_client *_client)
0
VALUE client = Data_Wrap_Struct(cClient, 0, 0, _client);
0
- // rb_iv_set(client, "@content_length", INT2FIX(_client->content_length));
0
void request_cb(ebb_client *_client, void *data)
0
VALUE server = (VALUE)data;
0
@@ -45,6 +45,7 @@ void request_cb(ebb_client *_client, void *data)
0
rb_ary_push(waiting_clients, client);
0
VALUE server_alloc(VALUE self)
0
struct ev_loop *loop = ev_default_loop (0);
0
@@ -56,16 +57,6 @@ VALUE server_alloc(VALUE self)
0
-// VALUE server_initialize(VALUE x, VALUE server)
0
-// struct ev_loop *loop = ev_default_loop (0);
0
-// ebb_server *_server;
0
-// Data_Get_Struct(server, ebb_server, _server);
0
VALUE server_listen_on_port(VALUE x, VALUE server, VALUE port)
0
@@ -111,6 +102,7 @@ VALUE server_process_connections(VALUE x, VALUE server)
0
VALUE server_unlisten(VALUE x, VALUE server)
0
@@ -119,7 +111,7 @@ VALUE server_unlisten(VALUE x, VALUE server)
0
-/* Variables with an underscore are C-level variables */
0
VALUE env_field(struct ebb_env_item *item)
0
@@ -150,6 +142,7 @@ VALUE env_field(struct ebb_env_item *item)
0
VALUE env_value(struct ebb_env_item *item)
0
if(item->value_length > 0)
0
@@ -158,6 +151,7 @@ VALUE env_value(struct ebb_env_item *item)
0
VALUE client_env(VALUE x, VALUE client)
0
@@ -198,6 +192,21 @@ VALUE client_read_input(VALUE x, VALUE client, VALUE size)
0
+VALUE client_write_status(VALUE x, VALUE client, VALUE status, VALUE human_status)
0
+ Data_Get_Struct(client, ebb_client, _client);
0
+ ebb_client_write_status(_client, FIX2INT(status), StringValuePtr(human_status));
0
+VALUE client_write_header(VALUE x, VALUE client, VALUE field, VALUE value)
0
+ Data_Get_Struct(client, ebb_client, _client);
0
+ ebb_client_write_header(_client, StringValuePtr(field), StringValuePtr(value));
0
VALUE client_write(VALUE x, VALUE client, VALUE string)
0
@@ -222,10 +231,6 @@ void Init_ebb_ext()
0
VALUE mEbb = rb_define_module("Ebb");
0
VALUE mFFI = rb_define_module_under(mEbb, "FFI");
0
- eParserError = rb_define_class_under(mEbb, "ParserError", rb_eIOError);
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
DEF_GLOBAL(http_prefix, "HTTP_");
0
@@ -244,7 +249,6 @@ void Init_ebb_ext()
0
cServer = rb_define_class_under(mEbb, "Server", rb_cObject);
0
rb_define_alloc_func(cServer, server_alloc);
0
- // rb_define_singleton_method(mFFI, "server_initialize", server_initialize, 1);
0
rb_define_singleton_method(mFFI, "server_process_connections", server_process_connections, 1);
0
rb_define_singleton_method(mFFI, "server_listen_on_port", server_listen_on_port, 2);
0
rb_define_singleton_method(mFFI, "server_listen_on_socket", server_listen_on_socket, 2);
0
@@ -252,8 +256,9 @@ void Init_ebb_ext()
0
cClient = rb_define_class_under(mEbb, "Client", rb_cObject);
0
rb_define_singleton_method(mFFI, "client_read_input", client_read_input, 2);
0
+ rb_define_singleton_method(mFFI, "client_write_status", client_write_status, 3);
0
+ rb_define_singleton_method(mFFI, "client_write_header", client_write_header, 3);
0
rb_define_singleton_method(mFFI, "client_write", client_write, 2);
0
rb_define_singleton_method(mFFI, "client_finished", client_finished, 1);
0
rb_define_singleton_method(mFFI, "client_env", client_env, 1);
Comments
No one has commented yet.