librelist archives

« back to archive

[PATCH] fix ListenStats documentation error in Raindrops::Linux.unix_listener_stats

[PATCH] fix ListenStats documentation error in Raindrops::Linux.unix_listener_stats

From:
Aman Gupta
Date:
2012-01-07 @ 07:48
Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 lib/raindrops/linux.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb
index 8a67887..fe2af09 100644
--- a/lib/raindrops/linux.rb
+++ b/lib/raindrops/linux.rb
@@ -27,8 +27,8 @@ module Raindrops::Linux
   #             SS_CONNECTED,             /* connected to socket          */
   #             SS_DISCONNECTING          /* in process of disconnecting  */
   #     } socket_state;
-  # * SS_CONNECTING maps to ListenStats#active
-  # * SS_CONNECTED maps to ListenStats#queued
+  # * SS_CONNECTING maps to ListenStats#queued
+  # * SS_CONNECTED maps to ListenStats#active
   #
   # This method may be significantly slower than its tcp_listener_stats
   # counterpart due to the latter being able to use inet_diag via netlink.
-- 
1.7.5.3

[PATCH] avoid calling tcp_listener_stats when it is not available

From:
Aman Gupta
Date:
2012-01-07 @ 07:48
Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 lib/raindrops/middleware.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/raindrops/middleware.rb b/lib/raindrops/middleware.rb
index a411de7..7c647ec 100644
--- a/lib/raindrops/middleware.rb
+++ b/lib/raindrops/middleware.rb
@@ -130,7 +130,7 @@ class Raindrops::Middleware
     body = "calling: #{@stats.calling}\n" \
            "writing: #{@stats.writing}\n"
 
-    if defined?(Raindrops::Linux)
+    if defined?(Raindrops::Linux.tcp_listener_stats)
       Raindrops::Linux.tcp_listener_stats(@tcp).each do |addr,stats|
         body << "#{addr} active: #{stats.active}\n" \
                 "#{addr} queued: #{stats.queued}\n"
-- 
1.7.5.3

Re: [raindrops] [PATCH] avoid calling tcp_listener_stats when it is not available

From:
Eric Wong
Date:
2012-01-07 @ 08:05
Aman Gupta <aman@tmm1.net> wrote:
> Signed-off-by: Aman Gupta <aman@tmm1.net>

Thanks, both patched acked and pushed out to "master" on
git://bogomips.org/raindrops.git and rdoc update pushed to
http://raindrops.bogomips.org/ too