* [ANN] raindrops 0.10.0 - minor feature updates
@ 2012-06-19 8:33 5% Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2012-06-19 8:33 UTC (permalink / raw)
To: raindrops
Changes:
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
* http://raindrops.bogomips.org/
* raindrops@librelist.org
* git://bogomips.org/raindrops.git
* http://raindrops.bogomips.org/NEWS.atom.xml
--
Eric Wong
^ permalink raw reply [relevance 5%]
* [PATCH] unix: show zero-value stats for idle listeners
@ 2012-06-13 1:39 4% Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2012-06-13 1:39 UTC (permalink / raw)
To: raindrops
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.
---
Pushed to "master" git://bogomips.org/raindrops
I'm thinking about releasing raindrops v0.10.0 soon.
I probably won't have time to use unix_diag functionality in the
Linux 3.3 kernel. I'm also lacking motivation since it'll be a
while before Linux 3.3 is widely-available on servers, and I'm
still supporting raindrops on 2.6.18 kernels :<
Brian Corrigan (1):
resolve symlinks to Unix domain sockets
Eric Wong (3):
unix_listener_stats follows and remembers symlinks
middleware/proxy: favor __send__ for method dispatch
unix: show zero-value stats for idle listeners
lib/raindrops/linux.rb | 14 ++++++++++----
test/test_linux.rb | 11 +++++++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
index 1752b8a..7cfb653 100644
--- a/lib/raindrops/linux.rb
+++ b/lib/raindrops/linux.rb
@@ -54,14 +54,20 @@ module Raindrops::Linux
Regexp.escape(path)
end
end
- paths = /^\w+: \d+ \d+ 00000000 \d+ (\d+)\s+\d+ (#{paths.join('|')})$/n
+ paths = /^\w+: \d+ \d+ (\d+) \d+ (\d+)\s+\d+ (#{paths.join('|')})$/n
# no point in pread since we can't stat for size on this file
File.read(*PROC_NET_UNIX_ARGS).scan(paths) do |s|
path = s[-1]
- case s[0].to_i
- when 2 then rv[path].queued += 1
- when 3 then rv[path].active += 1
+ case s[0]
+ when "00000000" # client sockets
+ case s[1].to_i
+ when 2 then rv[path].queued += 1
+ when 3 then rv[path].active += 1
+ end
+ else
+ # listeners, vivify empty stats
+ rv[path]
end
end
diff --git a/test/test_linux.rb b/test/test_linux.rb
index a84eecf..0e79a86 100644
--- a/test/test_linux.rb
+++ b/test/test_linux.rb
@@ -67,6 +67,17 @@ class TestLinux < Test::Unit::TestCase
assert_equal 1, stats[tmp.path].queued
end
+ def test_unix_all_unused
+ tmp = Tempfile.new("\xde\xad\xbe\xef") # valid path, really :)
+ File.unlink(tmp.path)
+ us = UNIXServer.new(tmp.path)
+ stats = unix_listener_stats
+ assert stats.keys.include?(tmp.path), stats.inspect
+
+ assert_equal 0, stats[tmp.path].active
+ assert_equal 0, stats[tmp.path].queued
+ end
+
def test_unix_resolves_symlinks
tmp = Tempfile.new("\xde\xad\xbe\xef") # valid path, really :)
File.unlink(tmp.path)
--
Eric Wong
^ permalink raw reply related [relevance 4%]
* Re: [PATCH] middleware/proxy: favor __send__ for method dispatch
2012-06-07 21:55 6% [PATCH] middleware/proxy: favor __send__ for method dispatch Eric Wong
@ 2012-06-08 18:11 7% ` Ben Somers
0 siblings, 0 replies; 4+ results
From: Ben Somers @ 2012-06-08 18:11 UTC (permalink / raw)
To: raindrops
> "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.
This seems eminently sensible and IIRC is the same way Rack does it.
Not sure why I changed it when making the original commit, I would
suspect my own foolishness.
^ permalink raw reply [relevance 7%]
* [PATCH] middleware/proxy: favor __send__ for method dispatch
@ 2012-06-07 21:55 6% Eric Wong
2012-06-08 18:11 7% ` Ben Somers
0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2012-06-07 21:55 UTC (permalink / raw)
To: raindrops
"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.
---
Pushed to "master" of git://bogomips.org/raindrops
lib/raindrops/middleware/proxy.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/raindrops/middleware/proxy.rb b/lib/raindrops/middleware/proxy.rb
index ce634bb..1cf437c 100644
--- a/lib/raindrops/middleware/proxy.rb
+++ b/lib/raindrops/middleware/proxy.rb
@@ -35,6 +35,6 @@ class Raindrops::Middleware::Proxy
# Avoid breaking users of non-standard extensions (e.g. #body)
# Rack::BodyProxy does the same.
def method_missing(*args, &block)
- @body.send(*args, &block)
+ @body.__send__(*args, &block)
end
end
--
1.7.11.rc0.55.gb2478aa
^ permalink raw reply related [relevance 6%]
Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-06-07 21:55 6% [PATCH] middleware/proxy: favor __send__ for method dispatch Eric Wong
2012-06-08 18:11 7% ` Ben Somers
2012-06-13 1:39 4% [PATCH] unix: show zero-value stats for idle listeners Eric Wong
2012-06-19 8:33 5% [ANN] raindrops 0.10.0 - minor feature updates Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/raindrops.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).