about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-03-29 19:01:24 -0700
committerEric Wong <normalperson@yhbt.net>2009-03-29 20:59:52 -0700
commit066226e97c1a08f927f62ae50d7e95a9ada4f303 (patch)
tree5f1fafb16ed79427a2df4c136fe9f31efc73ac98 /ext
parentdf58b5249c3e17ee4fab448224e3f043a2444fa0 (diff)
downloadunicorn-066226e97c1a08f927f62ae50d7e95a9ada4f303.tar.gz
"HTTP_BODY" could conflict with a "Body:" HTTP header if there
ever is one.  Also, try to hide this body from the Rack
environment before @app is called since it is only used by
Unicorn internally.
Diffstat (limited to 'ext')
-rw-r--r--ext/unicorn/http11/http11.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/unicorn/http11/http11.c b/ext/unicorn/http11/http11.c
index f62dce7..421e4d5 100644
--- a/ext/unicorn/http11/http11.c
+++ b/ext/unicorn/http11/http11.c
@@ -19,6 +19,7 @@
 static VALUE mUnicorn;
 static VALUE cHttpParser;
 static VALUE eHttpParserError;
+static VALUE sym_http_body;
 
 #define HTTP_PREFIX "HTTP_"
 #define HTTP_PREFIX_LEN (sizeof(HTTP_PREFIX) - 1)
@@ -31,7 +32,6 @@ static VALUE global_http_version;
 static VALUE global_content_length;
 static VALUE global_request_path;
 static VALUE global_content_type;
-static VALUE global_http_body;
 static VALUE global_server_name;
 static VALUE global_server_port;
 static VALUE global_server_protocol;
@@ -299,7 +299,7 @@ static void header_done(void *data, const char *at, size_t length)
   }
 
   /* grab the initial body and stuff it into the hash */
-  rb_hash_aset(req, global_http_body, rb_str_new(at, length));
+  rb_hash_aset(req, sym_http_body, rb_str_new(at, length));
   rb_hash_aset(req, global_server_protocol, global_server_protocol_value);
 }
 
@@ -413,7 +413,6 @@ void Init_http11()
   DEF_GLOBAL(http_version, "HTTP_VERSION");
   DEF_GLOBAL(request_path, "REQUEST_PATH");
   DEF_GLOBAL(content_length, "CONTENT_LENGTH");
-  DEF_GLOBAL(http_body, "HTTP_BODY");
   DEF_GLOBAL(content_type, "CONTENT_TYPE");
   DEF_GLOBAL(server_name, "SERVER_NAME");
   DEF_GLOBAL(server_port, "SERVER_PORT");
@@ -430,5 +429,6 @@ void Init_http11()
   rb_define_method(cHttpParser, "initialize", HttpParser_init,0);
   rb_define_method(cHttpParser, "reset", HttpParser_reset,0);
   rb_define_method(cHttpParser, "execute", HttpParser_execute,2);
+  sym_http_body = ID2SYM(rb_intern("http_body"));
   init_common_fields();
 }