about summary refs log tree commit homepage
path: root/ext/unicorn_http/ext_help.h
DateCommit message (Collapse)
2010-10-07http: remove unnecessary rb_str_update() calls
Rubinius no longer uses it, and it conflicts with a public method in MRI.
2010-06-12http: fix rb_str_set_len() define for 1.8.6
2010-06-10http: cleanups for latest Rubinius
Rubinius now supports rb_str_set_len() and sets -fPIC. We shouldn't check for rb_str_modify() since link-time detection is broken under Rubinius and even 1.8.6 has rb_str_modify().
2010-02-18http: avoid signedness warnings
We never come close to the signed limits anywhere, so it should be safe either way, but make paranoid compiler settings less noisy if possible.
2009-11-21http: Rubinius 0.13.0 compatibility fix
Rubinius appears to have changed semantics and our rb_str_set_len() emulation doesn't work anymore. Since rb_str_set_len() is just an optimized version of rb_str_resize(), we'll just use rb_str_resize() for now unless we notice something better. test_http_parser and test_http_parser_ng tests pass under Rubinius 0.13.0.
2009-09-15http: add #endif comment labels where appropriate
Sometimes I end up hacking on 10-row high terminals and need more context :x
2009-09-15http: cleanup assertion for memoized header strings
assert_frozen() should not be checking what type of object it is, instead put an extra assertion in there to ensure we have a string.
2009-09-14http: use rb_str_{update,flush} if available
Rubinius supports these functions as of 039091066244cfcf483310b86b5c4989aaa6302b This allows the test_http_parser_ng.rb test to run under Rubinius db612aa62cad9e5cc41a4a4be645642362029d20
2009-09-14http: no-op rb_str_modify() for Rubies without it
Rubinius has no rb_str_modify() function, it /may/ not need it.
2009-09-14http: define OFFT2NUM macro on Rubies without it
Hope they have the LL2NUM macro (Rubinius does)
2009-09-14http: support Rubies without the OBJ_FROZEN macro
Rubinius does not support frozen objects, maybe other Rubies lack support for it as well.
2009-08-09http: process Content-Length and Transfer-Encoding
Explicitly track if our request will need Content-Length or chunked body decoding.
2009-08-09http: generic C string vs VALUEs comparison function
The macro version lets us painlessly compare Ruby strings against constant C strings. It wraps a C version of the function which is necessary to avoid double evaluation while preventing the user from having to type sizeof or strlen.
2009-08-09http: move non-Ruby-specific macros c_util.h
2009-08-09unicorn_http: add helpful macros
We'll be needing the UH_OFF_T_MAX define for the chunked body handling and rb_str_set_len may be needed as well.
2009-08-09unicorn_http: small cleanups and size reduction
Use Data_Make_Struct instead of Data_Wrap_Struct to avoid extra steps/code in object allocation. The GC will also free() implicitly if no free callback is passed to Data_Make_Struct, and we don't need an extra method here... Since we're more comfortable with object management nowadays, just make the data_get() fail with an assertion failure if it somehow (very unlikely) ends up getting a NULL parser object. Unicorn itself has no way of recovering other than throwing errors to clients anyways and we have bigger problems if there's a GC bug causing this. Then, finally, reduce the size of our http_parser struct even more (we'll add an int back later) since we know it's safe to do so...
2009-07-15Rename unicorn/http11 => unicorn_http
We couldn't do proper namespacing for the C module so there was a potential conflict with Init_http11() in Mongrel. This was needed because Mongrel's HTTP parser could be used in some applications and we may be unfortunate enough need to support them.