about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2017-05-21Update respond_to? calls for second argument.
Rack (since v2) has started explicitly listing the second (optional) argument for respond_to?, which matches the underlying Ruby spec. This patch fixes the calls in both C and Ruby approaches. However, rb_respond_to only accepts a single argument - differing from the Ruby side of things - so perhaps this patch isn't quite perfect (and my C skills are very limited, so the whole thing could use a review).
2016-07-28doc use HTTPS for URLs and move homepage
Thanks to Let's Encrypt, the bogomips.org now supports HTTPS so our homepage can be moved to: https://bogomips.org/clogger/ While clogger.bogomips.org is part of the TLS certificate, it is needless subjectAltName bloat that should not have been created. This will also make it easier to have multiple homepages in the future as a Tor hidden service.
2016-07-28pure: remove Rack::Utils.bytesize dependency
This method is gone from rack 2.0 and not even necessary in Ruby 1.8.7. Yes, this breaks compatibility with Ruby 1.8.6 :P
2015-02-27pure: use monotonic clock if possible
Ruby 2.1.0 and later exposes Process.clock_gettime, resulting in less garbage and access to the monotonic clock if it is available. Try to use it to achieve feature parity with the C extension (which has always used the monotonic clock if possible).
2015-02-27pure: fix reentrancy of request_time
For users unable to compile the C extension, multithreaded usage of clogger could return invalid request time measurements. This does not affect users of the C extension.
2014-05-12remove :to_io support
:to_io never was a Rack extension, and ends up breaking the case where an SSL socket is proxied. The role of :to_io in IO-like objects is to aid IO.select and like methods.
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-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-16:format may be a Symbol for less typing
This allows using: use Clogger, :format => :Rack_1_0 Instead of: use Clogger, :format => Clogger::Format::Rack_1_0
2011-03-15clogger: remove VERSION constant
People shouldn't care, there have been no backwards-incompatible changes in the UI and we're not a library people write code against.
2011-01-21clogger 0.8.0 - delegating away! v0.8.0
Clogger now delegates all unknown methods to the response body in cases where it needs to wrap the response body. This allows apps that use non-standard Rack extensions to continue working. Eric Wong (4): pass along "to_io" calls to the body delegate method_missing calls to the response body pure: simpler autoload trigger switch to pkg.mk for maintenance tasks
2011-01-21pure: simpler autoload trigger
No need to actually create the hash, just load the constant
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-14clogger 0.7.0 - portability improvements, cleanups v0.7.0
Broken/crazy systems without CLOCK_MONOTONIC (in varying degrees) and/or clock_gettime() should be supported by using gettimeofday(). Thanks to Lawrence Pit for reporting and helping us test. The Clogger::ToPath proxy class is gone, Clogger itself can proxy to_path/close calls correctly to the response body. $time_utc with a default strftime-format is now supported, and time formats can now be arbitrarily long in the C extension.
2011-01-14properly support $time_utc as documented
nginx doesn't have this, only time_local, but we do
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-14remove Clogger::ToPath proxy class
We can just make Clogger#respond_to? smarter and forward everything except :close to the body we're proxying.
2010-12-25clogger 0.6.0 - :path shortcut, minor bugfixes v0.6.0
Clogger may now be initialized with a :path instead of :logger to avoid typing "::File" in config.ru files to avoid conflicting with the completely-unrelated Rack::File. $request_time is now uses the monotonic clock, making it immune to system clock changes. $usec and $msec statements were completely broken in the pure-Ruby code and now fixed. Rubinius is supported by the optional C extension as well, the pure-Ruby code always worked.
2010-12-25fix $msec and $usec in pure Ruby variant
It was totally broken but nobody uses uses it, so it went unnoticed since the beginning of time.
2010-12-24eliminate unnecessary freeze and dup
They're not needed and a waste of code.
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-06clogger 0.5.0 - body.to_path forwarding v0.5.0
This release allows middleware like Rack::Contrib::Sendfile to work properly higher up the stack from Clogger. Certain configurations of the Rainbows! and Zbatery web servers are able to use the return value of body.to_path to serve static files efficiently (via IO.copy_stream under 1.9 or stream_file_data with EventMachine). There are some small cleanups and documentation improvements as well. I've relicensed to LGPLv2.1+ (from LGPLv3-only) to allow bundling with GPLv2-only applications (I'm currently the sole copyright holder). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2010-06-06CLOGGER_PURE=0 disables the C ext
It's unintuitive that merely setting the environment variable to an empty string or zero would be a boolean true.
2010-06-06no point in using autoload for Rack
Rack is always used, and Rack itself uses autoload to save memory.
2010-06-06doc: RDoc cleanups, split out LICENSE file
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-21clogger 0.4.0 v0.4.0
Small cleanups and minor enhancements (mainly for the optional C extension) for this release: Eric Wong (10): ext: use FIX macros instead of generic NUM macros if possible ext: preserve subclasses of Rack::Utils::HeaderHash test: fix Linux memory usage test avoid direct require of "rack" to quiet warnings ext: GC safety fix when throwing an exception ext: eliminate unused variable ext: fix signedness and shadow warnings ext: sparse cleanups ext: avoid void pointer arithmetic clogger 0.4.0
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-02-13clogger 0.3.2 v0.3.2
This release fixes a memory leak in the optional C extension due to misuse of the Ruby C API. Users of the pure Ruby version are unaffected. We also misreleased 0.3.1 with this fix, but without bumping the Clogger::VERSION constant.
2010-02-09clogger 0.3.0 v0.3.0
You may now force the :reentrant flag to +true+ or +false+ in your Rack configuration file: use Clogger, :format => Clogger::Format::Combined, :logger => ::File.open("/path/to/log", "ab"), :reentrant => true This is to be compatible with Rack servers that do not use use events or Fibers for concurrency instead of threads. By default, reentrancy is enabled if env["rack.multithread"] is true, but "rack.multithread" cannot indicative of a reentrancy requirement in a web server.
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-06clogger 0.2.0 v0.2.0
The optional C extension no longer tries to preserve the original response array as it could become subtly broken by people using non-frozen but constant responses. For the pure Ruby version, there is a 1.9-encoding bugfix for response size calculation.
2010-01-06pure: use Rack::Utils.bytesize instead of String#size
hacking the C extension with RSTRING_LEN() is so much easier :P
2010-01-06pure: avoid unnecessary method dispatches
instance variable lookups are expensive as-is
2009-10-06clogger 0.1.0 v0.1.0
This release should help ensure compatibility with a to-be-released version of Rack::Lint that allows subclasses of the core String and Hash objects for users of the optional C extension. Eric Wong (6): ext: convert non-Hashes #to_hash if possible ext: ensure all objects we byte_xs are Strings tests for subclassing gemspec: disable the license= field for older RubyGems GNUmakefile: fix grammar FAIL in comment cleanup packaging and website/rdoc
2009-09-09clogger 0.0.7 v0.0.7
We now properly handle bodies that do not respond to the :close method. Additionally there small documentation/formatting fixes.
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-07clogger 0.0.6 v0.0.6
"clogger_ext" is no longer a separate gem, but merged into the "clogger" gem itself. The installation should automatically detect compatible versions of Ruby and only build the C extension for MRI 1.8/1.9. Rack::Utils::HeaderHash is now used for $sent_http_* variable lookups instead of a hand-rolled solution. HeaderHash objects should be reusable in Rack soon to avoid the penalty of recreating them repeatedly in middlewares and hopefully more-widely used as a result. Underlying logger objects are sync=true for safety reasons. This has always been the case for the C extension version when writing to regular files. Other small changes include more CGI variables and the :ORS (output record separator) option added (default: "\n").
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-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-03add support for several more CGI variables
$auth_type, $gateway_interface, $server_software, $path_translated are all supported now.
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-03CLOGGER_PURE forces the pure version to be loaded
This is useful for testing the pure Ruby version in case clogger_ext is already installed on your system.
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-02clogger 0.0.5 v0.0.5