about summary refs log tree commit homepage
path: root/ext/unicorn_http/ext_help.h
DateCommit message (Collapse)
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.