From d100025759450dd1cbeccd1a3e44c46921bba26b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 4 Jan 2011 17:50:51 -0800 Subject: http_response: implement httpdate in C This can return a static string and be significantly faster as it reduces object allocations and Ruby method calls for the fastest websites that serve thousands of requests a second. It assumes the Ruby runtime is single-threaded, but that is the case of Ruby 1.8 and 1.9 and also what Unicorn is all about. This change is safe for Rainbows! under 1.8 and 1.9. --- ext/unicorn_http/unicorn_http.rl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/unicorn_http/unicorn_http.rl') diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 9b33e31..fd259b6 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -12,6 +12,8 @@ #include "global_variables.h" #include "c_util.h" +void init_unicorn_httpdate(void); + #define UH_FL_CHUNKED 0x1 #define UH_FL_HASBODY 0x2 #define UH_FL_INBODY 0x4 @@ -897,5 +899,6 @@ void Init_unicorn_http(void) SET_GLOBAL(g_content_length, "CONTENT_LENGTH"); SET_GLOBAL(g_http_connection, "CONNECTION"); id_clear = rb_intern("clear"); + init_unicorn_httpdate(); } #undef SET_GLOBAL -- cgit v1.2.3-24-ge0c7