about summary refs log tree commit homepage
path: root/ext/clogger_ext/clogger.c
DateCommit message (Collapse)
2009-09-07Don't bother creating HeaderHash unless we need it
It's expensive to create if not needed, and no current released version of Rack has my proposed optimizations for it yet...
2009-09-07ext: hack to prevent rdoc from finding Rack* namespace
TODO: find a better way to do this...
2009-09-04ext: only duplicate frozen response arrays
Otherwise modify the response array in place since most frameworks give you a modifiable array for you to play with anyways.
2009-09-04use Rack::Utils::HeaderHash for $sent_http_* lookups
No point in having extra code to do case-insensitive lookups, especially since the HeaderHash implementation is already in wide use and will only get faster as time goes by.
2009-09-04ext: store each response element explicitly
Avoid calling RARRAY_PTR all over the place and make the code easier to read/audit as a result.
2009-09-04ext: more consistent function naming
s/init_bad_response/init_bad_app_response/ The new name matches the variable it initializes more closely.
2009-09-03add output record separator option (:ORS)
This allows overriding the default of "\n". Behavior remains similar to IO#puts, the :ORS (output record separator) is appended iff the format doesn't already end with that string.
2009-09-03Ensure underlying logger objects are sync=true
Userspace buffering defaults are dangerous as the Ruby default IO objects do not do line-aware buffering. This makes the README examples with File.open much safer to use out-of-the-box for users of the pure-Ruby version. For users on the MRI C extension logging to regular files, this should not have any effect as we've optimized those to do unbuffered write(2) syscalls anyways.
2009-09-01correctly rebuild simple HTTP/0.9 GET requests
Back in HTTP/0.9 days (before it was called HTTP/0.9), "GET /uri/goes/here\r\n" was a valid HTTP request. See rfc 1945, section 4.1 for details on this ancient "Simple-Request" scheme used by HTTP/0.9 clients.
2009-09-01ext: ensure headers#each in response is valid
We're not Rack::Lint, but we still need to take steps to avoid segfaulting if we host non-Rack::Lint-compliant applications. This also updates the pure variant to fail on bad applications, too.
2009-09-01ext: compiler compatibility fix
Remove trailing "," for enum
2009-08-29ext: several cleanups and robustness improvements
Add a little more tolerance for bad applications that may not give us string objects. This should only have a minor performance penalty for proper applications but at least ensures we don't segfault on misbehaving apps.
2009-08-29ext: explicitly gc_mark each struct element
rb_gc_mark_locations doesn't seem in common use for structs and there was a fencepost error so the response element didn't seem to be marked at times. This should fix random errors I've been seeing on big/longer response bodies.
2009-08-29Log bad/invalid app responses as 500 errors
Some misbehaved apps can do this to us, and we don't want the C extension to segfault when this happens.
2009-08-29support "$request_uri" as a log variable
This was documented in the README but never implemented. Some popular web servers set REQUEST_URI even though it's not required by Rack, so allow this variable to be used if possible. As a side effect, it is also less likely to be modified by certain handlers (*cough*Rails::Rack::Static*cough*).
2009-08-28initial import