about summary refs log tree commit homepage
path: root/ext/unicorn_http/global_variables.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-02 15:25:42 -0700
committerEric Wong <normalperson@yhbt.net>2009-08-09 01:28:25 -0700
commit0d89349e78092ad65dfca5b9131218cef0476a37 (patch)
tree6faf13857332d6c5695fc489dff575bd0a924b65 /ext/unicorn_http/global_variables.h
parent4c46783d3ea2114ff8379558a0b1d1e9e933b8f1 (diff)
downloadunicorn-0d89349e78092ad65dfca5b9131218cef0476a37.tar.gz
Just extra noise we don't care about.  This also allows us to
undef the DEF_GLOBAL macro to avoid polluting the main
namespace.
Diffstat (limited to 'ext/unicorn_http/global_variables.h')
-rw-r--r--ext/unicorn_http/global_variables.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/unicorn_http/global_variables.h b/ext/unicorn_http/global_variables.h
index 1091909..7feef93 100644
--- a/ext/unicorn_http/global_variables.h
+++ b/ext/unicorn_http/global_variables.h
@@ -54,4 +54,34 @@ DEF_MAX_LENGTH(REQUEST_PATH, 1024);
 DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
 DEF_MAX_LENGTH(HEADER, (1024 * (80 + 32)));
 
+void init_globals(void)
+{
+  mUnicorn = rb_define_module("Unicorn");
+
+  DEF_GLOBAL(rack_url_scheme, "rack.url_scheme");
+  DEF_GLOBAL(request_method, "REQUEST_METHOD");
+  DEF_GLOBAL(request_uri, "REQUEST_URI");
+  DEF_GLOBAL(fragment, "FRAGMENT");
+  DEF_GLOBAL(query_string, "QUERY_STRING");
+  DEF_GLOBAL(http_version, "HTTP_VERSION");
+  DEF_GLOBAL(request_path, "REQUEST_PATH");
+  DEF_GLOBAL(path_info, "PATH_INFO");
+  DEF_GLOBAL(server_name, "SERVER_NAME");
+  DEF_GLOBAL(server_port, "SERVER_PORT");
+  DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
+  DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
+  DEF_GLOBAL(http_x_forwarded_proto, "HTTP_X_FORWARDED_PROTO");
+  DEF_GLOBAL(port_80, "80");
+  DEF_GLOBAL(port_443, "443");
+  DEF_GLOBAL(localhost, "localhost");
+  DEF_GLOBAL(http, "http");
+
+  eHttpParserError =
+         rb_define_class_under(mUnicorn, "HttpParserError", rb_eIOError);
+  cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject);
+  sym_http_body = ID2SYM(rb_intern("http_body"));
+}
+
+#undef DEF_GLOBAL
+
 #endif /* global_variables_h */