diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-02-18 18:48:38 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-02-18 19:30:51 -0800 |
commit | 4ee6275918cf15c1c380e0adc46e2516433d76fa (patch) | |
tree | aebfeb651c22cb3a1cbbff36f8de20c1a3880821 /ext/unicorn_http/unicorn_http.rl | |
parent | 4347b8987732b5bea83ddb8fb9605cf2c4a1c2fe (diff) | |
download | unicorn-4ee6275918cf15c1c380e0adc46e2516433d76fa.tar.gz |
* init_globals() is a static function, avoid conflicting with any potential libraries out there... * mUnicorn and cHttpParser do not need to be static globals they're not used outside of Init_unicorn_http().
Diffstat (limited to 'ext/unicorn_http/unicorn_http.rl')
-rw-r--r-- | ext/unicorn_http/unicorn_http.rl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index eeef5e1..0c58473 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -674,10 +674,13 @@ static VALUE HttpParser_filter_body(VALUE self, VALUE buf, VALUE data) void Init_unicorn_http(void) { + VALUE mUnicorn, cHttpParser; + mUnicorn = rb_define_module("Unicorn"); + cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject); eHttpParserError = rb_define_class_under(mUnicorn, "HttpParserError", rb_eIOError); - cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject); + init_globals(); rb_define_alloc_func(cHttpParser, HttpParser_alloc); rb_define_method(cHttpParser, "initialize", HttpParser_init,0); |