about summary refs log tree commit homepage
path: root/ext
DateCommit message (Collapse)
2013-09-26ext: avoid RARRAY_PTR usage for RGenGC in Ruby 2.1.0
I have not benchmarked this, but this is unlikely to be a bottleneck at all in older Rubies. It results in a smaller binary, too, which will help with icache bloat. This should also improve performance under Rubinius, too.
2012-11-06ext: enable C extension under Ruby 2.0.0
Ruby 2.0.0preview1 is out, and we happen to be compatible (with some harmless linker/build warnings)
2012-11-02avoid calling "<<" on env["rack.errors"]
Rack::Lint::ErrorWrapper forbids the "<<" method. This fallback only comes into play when no log destination (via :logger or :path) is specified and is rarely an issue in real setups.
2011-12-05escape individual cookie values from $cookie_*
These values are untrusted, so if any client sends them to us we must escape them.
2011-12-05escape bytes in the 0x7F-0xFF range, too
This matches the behavior of nginx 1.0.9
2011-07-20ext: note we rely on GVL for reentrancy detection
Nothing wrong with the GVL in Ruby 1.9.3; but we'll need to modify our code if it's removed for C extensions.
2011-06-22ext: fix portability defines for some installs
Some Ruby installs muck up headers/#defines and cause weirdness. We now explicitly define _BSD_SOURCE and include #stdio.h
2011-04-19$time_local and $time_utc are locale-independent
This doesn't apply to people that use strftime()-formats, but that's a minority.
2011-04-16add support for $time_iso8601 format
This appeared in nginx 0.9.6
2011-03-21extconf: unnecessary dir_config statement
Braindamage from back in the day when I didn't understand mkmf
2011-03-16fix documentation of Clogger.new for :path
Oops
2011-03-13avoid potential RString -> C-string conversions
Unlikely, but it may make a difference somewhere...
2011-03-13release GVL for filesystem operations
While local filesystems are usually very fast, we are pessimistic and should prepare for worst-case scenarios. This can use rb_thread_io_blocking_region() under Ruby 1.9.3dev.
2011-03-13ext: ensure path is a valid C string
Unlikely, but some app could pass '\0' into us
2011-03-04ext: avoid potentially unsafe casts with C API
Rubinius may be pickier about what a VALUE is, so we can't safely cast any C address into VALUEs.
2011-01-21delegate method_missing calls to the response body
Since we delegated response_to?, we also need to delegate method_missing to the response body in case there are non-standard methods defined outside of Rack.
2011-01-21pass along "to_io" calls to the body
This optimization is used by Rainbows! to pass IO objects to the response body.
2011-01-14handle abitrarily long time formats in C extension
In case some folks need to use insanely long time formats, we'll support them.
2011-01-14RDoc fixups
call-seq is needed to make C functions look good
2011-01-14remove dead RSTRUCT* compatibility macros
The Clogger::ToPath proxy struct class is gone and so is our need to access it.
2011-01-14remove Clogger::ToPath proxy class
We can just make Clogger#respond_to? smarter and forward everything except :close to the body we're proxying.
2011-01-14another try to fix systems without CLOCK_MONOTONIC
Fix a reversed typedef and also deal with the case where CLOCK_MONOTONIC is a function call and not a constant macro.
2011-01-14another workaround for systems with broken CLOCK_MONOTONIC
This should also detect cases where CLOCK_MONOTONIC is available at build but not at runtime.
2011-01-12attempt to support broken/crazy systems
clock_gettime() is not available on some systems and/or CLOCK_MONOTONIC. This is totally broken considering the POSIX standard was 10 years ago, now. Nothing in gnulib, either, wtf?! http://www.gnu.org/software/gnulib/manual/html_node/clock_005fgettime.html
2011-01-12remove unused function (obj_fileno)
2010-12-25add support for Rubinius
RSTRUCT_PTR access is unlikely to ever happen for Rubinius, so we'll just make a method dispatch and leave the faster code for Ruby 1.8 and 1.9.
2010-12-24fix #include ordering under FreeBSD 7.2
ruby.h doesn't seem to like being included after time.h
2010-12-24use clock_gettime for time resolution
This lets us use CLOCK_MONOTONIC so we are not affected by system clock changes. We still convert to microseconds instead of nanoseconds for (pure)-Ruby 1.8 code compatibility. There is also little need for nanosecond timer resolution in log files (microsecond is not needed, even).
2010-12-24accept a new :path argument in initialize
This lessens confusion for people configuring Clogger in config.ru, since "File" could be mistaken for Rack::File and "::File" needs to be specified.
2010-06-06ext: comment why we do what we do in to_path
2010-06-06ext: the N in /dev/fd/N must be unsigned
There's no way in hell a valid file descriptor can have a negative number attached to it.
2010-06-06ext: handle weird regular files with O_NONBLOCK set
Sometimes programmers can blindly set O_NONBLOCK on everything in sight. However, O_NONBLOCK has no effect on regular files, so ignore it and allow the raw file descriptor to be used.
2010-06-06ext: cleanup -Wshadow warning
2010-06-06pass-through body.to_path when wrapping the body
Certain configurations of Rainbows! (and Zbatery) are able to use the return value of body.to_path to serve static files more efficiently. This also allows middleware like Rack::Contrib::Sendfile to work properly higher up the stack, too.
2010-06-06when wrapping the body, body.close writes the log
We no longer write the log out at the end of the body.each call. This is a behavioral change, but fortunately all Rack servers I've seen call body.close inside an ensure. This allows us to later pass along the "to_path" method and not rely on "each" to write the log.
2010-04-21ext: avoid void pointer arithmetic
default CFLAGS for 1.9.2dev complains
2010-04-21ext: sparse cleanups
2010-04-21ext: fix signedness and shadow warnings
These were (fortunately) harmless, but better safe than sorry.
2010-04-21ext: eliminate unused variable
2010-04-21ext: GC safety fix when throwing an exception
The return value of rb_inspect() may not be visible on the stack without assigning it to a local variable first.
2010-04-21avoid direct require of "rack" to quiet warnings
This quiets down warnings when used with RubyGems loaders such as Isolate and Bundler where the HTTP server already loaded Rack.
2010-04-08ext: preserve subclasses of Rack::Utils::HeaderHash
some people subclass HeaderHash and want them preserved through the middleware stack.
2010-04-08ext: use FIX macros instead of generic NUM macros if possible
They're slightly faster when we know a number is small enough to be a FIXNUM.
2010-02-13ext: fix memory leak when reentrant/multithreaded v0.3.1
The optional C extension leaked memory due to improper use of the Ruby API, causing duplicated objects to never be garbage collected. I misread the Data_Make_Struct/Data_Wrap_Struct documentation and ended up passing NULL as the "free" argument instead of -1, causing the memory to never be freed. From README.EXT in the MRI source which I misread: > The free argument is the function to free the pointer > allocation. If this is -1, the pointer will be just freed. > The functions mark and free will be called from garbage > collector.
2010-02-08Allow :reentrant flag to be forced true/false
Clogger may set this value independently of "rack.multithread" since Actor/Fiber-based servers may have multiple instances of Clogger wrapping different response bodies and yet be incompatible with "rack.multithread"
2010-01-06ext: unpack response arrays unconditionally
It's too crazy to have to special case for frozen response constants. 3-element arrays are cheap under Ruby 1.9 anyways.
2009-10-06ext: ensure all objects we byte_xs are Strings
Rack will be relaxing the spec to allow subclasses of String objects. Just in case they're not compatible, we'll convert them to strings.
2009-10-06ext: convert non-Hashes #to_hash if possible
This is to remain compatible with Rack if it relaxes Rack::Lint to allow subclasses.
2009-09-09handle bodies that do not respond to :close
Since the wrapped Clogger object always responds to close, we cannot blindly delegate the close method to the body without ensuring it can be closed. So ensure that it can be closed before attempting to close it, all return values and errors are trapped and returned. Reported-by: IƱaki Baz Castillo
2009-09-07ext: fix compiler warnings in the cpp "comment"