eventmachine-eventmachine_httpserver 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{eventmachine_httpserver}
5
- s.version = "0.1.2"
5
+ s.version = "0.2.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Francis Cianfrocca"]
data/ext/rubyhttp.cpp CHANGED
@@ -170,7 +170,7 @@ void RubyHttpConnection_t::ProcessRequest (const char *request_method,
170
170
  Statics
171
171
  *******/
172
172
 
173
-
173
+ VALUE Intern_http_conn;
174
174
 
175
175
  /***********
176
176
  t_post_init
@@ -182,7 +182,7 @@ static VALUE t_post_init (VALUE self)
182
182
  if (!hc)
183
183
  throw std::runtime_error ("no http-connection object");
184
184
 
185
- rb_ivar_set (self, rb_intern ("@http______conn"), INT2NUM ((long)hc));
185
+ rb_ivar_set (self, Intern_http_conn, LONG2NUM ((long)hc));
186
186
  return Qnil;
187
187
  }
188
188
 
@@ -194,7 +194,7 @@ t_receive_data
194
194
  static VALUE t_receive_data (VALUE self, VALUE data)
195
195
  {
196
196
  int length = NUM2INT (rb_funcall (data, rb_intern ("length"), 0));
197
- RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2INT (rb_ivar_get (self, rb_intern ("@http______conn"))));
197
+ RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2LONG (rb_ivar_get (self, Intern_http_conn)));
198
198
  if (hc)
199
199
  hc->ConsumeData (StringValuePtr (data), length);
200
200
  return Qnil;
@@ -216,7 +216,7 @@ t_unbind
216
216
 
217
217
  static VALUE t_unbind (VALUE self)
218
218
  {
219
- RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2INT (rb_ivar_get (self, rb_intern ("@http______conn"))));
219
+ RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2LONG (rb_ivar_get (self, Intern_http_conn)));
220
220
  if (hc)
221
221
  delete hc;
222
222
  return Qnil;
@@ -240,7 +240,7 @@ t_no_environment_strings
240
240
 
241
241
  static VALUE t_no_environment_strings (VALUE self)
242
242
  {
243
- RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2INT (rb_ivar_get (self, rb_intern ("@http______conn"))));
243
+ RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2LONG (rb_ivar_get (self, Intern_http_conn)));
244
244
  if (hc)
245
245
  hc->SetNoEnvironmentStrings();
246
246
  return Qnil;
@@ -252,7 +252,7 @@ t_dont_accumulate_post
252
252
 
253
253
  static VALUE t_dont_accumulate_post (VALUE self)
254
254
  {
255
- RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2INT (rb_ivar_get (self, rb_intern ("@http______conn"))));
255
+ RubyHttpConnection_t *hc = (RubyHttpConnection_t*)(NUM2LONG (rb_ivar_get (self, Intern_http_conn)));
256
256
  if (hc)
257
257
  hc->SetDontAccumulatePost();
258
258
  return Qnil;
@@ -265,17 +265,15 @@ Init_eventmachine_httpserver
265
265
 
266
266
  extern "C" void Init_eventmachine_httpserver()
267
267
  {
268
- // INCOMPLETE, we need to define class Connections inside module EventMachine
269
-
270
- VALUE Monorail = rb_define_module ("EventMachine");
271
- VALUE EmModule = rb_define_module_under (Monorail, "HttpServer");
272
- rb_define_method (EmModule, "post_init", (VALUE(*)(...))t_post_init, 0);
273
- rb_define_method (EmModule, "receive_data", (VALUE(*)(...))t_receive_data, 1);
274
- rb_define_method (EmModule, "receive_post_data", (VALUE(*)(...))t_receive_post_data, 1);
275
- rb_define_method (EmModule, "unbind", (VALUE(*)(...))t_unbind, 0);
276
- rb_define_method (EmModule, "process_http_request", (VALUE(*)(...))t_process_http_request, 0);
277
- rb_define_method (EmModule, "no_environment_strings", (VALUE(*)(...))t_no_environment_strings, 0);
278
- rb_define_method (EmModule, "dont_accumulate_post", (VALUE(*)(...))t_dont_accumulate_post, 0);
268
+ Intern_http_conn = rb_intern ("http_conn");
269
+
270
+ VALUE EmModule = rb_define_module ("EventMachine");
271
+ VALUE HttpServer = rb_define_module_under (EmModule, "HttpServer");
272
+ rb_define_method (HttpServer, "post_init", (VALUE(*)(...))t_post_init, 0);
273
+ rb_define_method (HttpServer, "receive_data", (VALUE(*)(...))t_receive_data, 1);
274
+ rb_define_method (HttpServer, "receive_post_data", (VALUE(*)(...))t_receive_post_data, 1);
275
+ rb_define_method (HttpServer, "unbind", (VALUE(*)(...))t_unbind, 0);
276
+ rb_define_method (HttpServer, "process_http_request", (VALUE(*)(...))t_process_http_request, 0);
277
+ rb_define_method (HttpServer, "no_environment_strings", (VALUE(*)(...))t_no_environment_strings, 0);
278
+ rb_define_method (HttpServer, "dont_accumulate_post", (VALUE(*)(...))t_dont_accumulate_post, 0);
279
279
  }
280
-
281
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventmachine-eventmachine_httpserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Cianfrocca