extconf: better check for GCC atomic builtins

Attempting to test for CMPXCHG on x86 should allow this check to
fail on i386 systems.  We also won't need try_run as a result,
enabling cross-compilation.  The configure.in check in Ruby
1.9.3 does something similar and that's far more widely used
than raindrops is.
avoid warning for rb_thread_io_blocking_region

This is exported (visibly) under Ruby 1.9.3 but not
in headers, so it was causing warnings.
raindrops 0.8.1 - compatibility fixes

This release fixes a build problem found under a current SmartOS.  This
release also runs successfully on FreeBSD 9.0 under both x86-64 and
i386.

There are also documentation updates from Aman Gupta and a test suite
fix from Jeremy Evans for OpenBSD.

raindrops fully supports unicorn on recent versions of FreeBSD, OpenBSD,
SmartOS, and possibly other Free Software systems.  Portability reports
and fixes for Free Software systems is greatly appreciated at
raindrops@librelist.org

Non-Free systems will never be supported.

raindrops requires the Linux 2.6.18 or later for full functionality
(which unicorn does not require).  Future releases will take advantage
of the unix_diag functionality found in the Linux 3.3 (and later)
kernels.
Add method_missing to Raindrops::Middleware::Proxy

This enables it to behave more like a Rack
BodyProxy would, delegating methods to its body
object when it does not implement them itself.
(Also includes  a minor grammar fix to a comment.)

[ew: minor comment/whitespace fix]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
middleware/proxy: fixup comment/whitespace

Noted, but not fixed in the previous commit
commit abc6dd47ede5b96ada1ff8f37dfba73cd5fd586a
(Add method_missing to Raindrops::Middleware::Proxy)
raindrops 0.9.0 - minor middleware/proxy update

Raindrops::Middleware::Proxy now forwards method_missing
to the proxied body object.  This allows compatibility
with non-standard Rack extensions employed by some
middlewares, applications, or servers.

Thanks to Ben Somers for the feature!
resolve symlinks to Unix domain sockets

Raindrops currently fails when provided a symlink to a socket.
As this is a common practice for many deployment tools (Vlad,
etc.) this patch adds support for finding the realpath prior to
looking the socket up in /proc/net/unix

[ew: commit message subject]

[ew: fixed test to pass under 1.9.3 and 1.8.7:
* Tempfile#unlink is unsafe to call if we want to reuse the
  path, use File.unlink(tmp.path) instead

* The return value of File.symlink is zero (or it raises),
  so it's unusable.

* File.symlink will not call #to_path under 1.8.7, so it's
  necessary to pass pathnames to it, not Tempfile objects.
]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
unix_listener_stats follows and remembers symlinks

Teach unix_listener_stats to remember the symlink path
it followed and have it point to the same object as the
resolved (real) socket path.

This allows the case where looking up stats by symlinks
works if the symlink is given to unix_listener_stats:

  File.symlink("/real/path/of.sock", "/path/to/link.sock")
  stats = unix_listener_stats(["/path/to/link.sock"])
  stats["/path/to/link.sock"] => # same as stats["/real/path/of.sock"]
middleware/proxy: favor __send__ for method dispatch

"send" is more likely to be overridden in subclasses whereas
the Ruby runtime (at least 1.9.3) will warn loudly if any user
code (re)defines the "__send__" method.

For example, BasicSocket#send and UDPSocket#send in the Ruby
stdlib are wrappers for the send(2)/sendto(2) system calls,
and it's entirely possible an application could return a
Socket-subclass as a Rack response body.
unix: show zero-value stats for idle listeners

When unix_listener_stats is called without arguments, it should
still match the behavior of tcp_listener_stats and return
ListenerStats object with zero values.

This allows callers to iterate through the results to find the
pathnames of all the Unix domain sockets in in listen mode.
test_watcher: fix incorrect request/date comparison

It makes no sense to compare peak times of different queues
(active vs queued) against each other.
watcher: sort index of listener listing

For hosts with many listeners, it should be easier to read the
index page if the results are shown in a consistent order.

Requested privately via email to raindrops@bogomips.org
watcher: do not require Rack::Head for HEAD response

Rack webservers are not guaranteed to include Rack::Head in the
middleware stack.  Watcher is a standalone app, so it cannot
rely on a framework which automatically includes Rack::Head.
raindrops 0.10.0 - minor feature updates

Improvements to the Unix domain socket handling and small
bugfixes throughout.

Support for the "unix_diag" facility in Linux 3.3+ is planned
but not yet implemented (patches to raindrops@librelist.org
appreciated)

Brian Corrigan (1):
      resolve symlinks to Unix domain sockets

Eric Wong (6):
      unix_listener_stats follows and remembers symlinks
      middleware/proxy: favor __send__ for method dispatch
      unix: show zero-value stats for idle listeners
      test_watcher: fix incorrect request/date comparison
      watcher: sort index of listener listing
      watcher: do not require Rack::Head for HEAD response

See "git log v0.9.0..v0.10.0" for full details
Watcher: Use relative paths in HTML links

When I mount Raindrops::Watcher like so:

   map "/_raindrops" do
     run Raindrops::Watcher.new
   end

Then in the HTML output links use an absolute path instead of relative
to the path /_raindrops/

Cheers,
Lawrence

Signed-off-by: Eric Wong <normalperson@yhbt.net>
raindrops: favor configured processor count over online count

The runnable CPUs of a process may change over the lifetime of
the process.  So favor the count of configured processor count
since that is more likely to be stable.

We do not currently do not have special handling for
hot-plugging/removal of CPUs on systems that may load raindrops
in a single CPU state.
watcher: set Content-Type via assignment

Relying on String#replace to set Content-Type stopped working
with rack commit 3623d04526b953a63bfb3e72de2d6920a042563f
This fixes compatibility with the Rack 1.5.x series.
Linux::TCP_Info: implement #get! instance method

This allows reusing existing Linux::TCP_Info objects to avoid
generating garbage.
linux_inet_diag: avoid unnecessary sockaddr initialization

This initialization was unnecessary and avoids the following
warning with -Wmissing-braces on gcc 4.7.2-5 on Debian testing:

  linux_inet_diag.c: In function ‘stats_for’:
  linux_inet_diag.c:192:8: warning: missing braces around initializer [-Wmissing-braces]
  linux_inet_diag.c:192:8: warning: (near initialization for ‘sa.ss’) [-Wmissing-braces]
.gitignore: add .rbx

Rubinius drops a .rbx directory on us nowadays