Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] Rainbows! 4.7.0 - Rack HTTP server for the sleepy
@ 2015-10-19 21:28  4% Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-10-19 21:28 UTC (permalink / raw)
  To: rainbows-public; +Cc: ruby-talk

Rainbows! is an HTTP server for sleepy Rack applications.
Use of Rainbows! for new projects is not recommended,
try other servers instead.

Changes since 4.6.2:

    Rainbows! 4.7.0 - updates for ruby 2.3.0dev

    This release includes fixes for upcoming changes in Ruby 2.3.0
    (due December 2015).  Use of Rainbows! for new projects is not
    recommended, try other servers instead.

    * update dependencies for Ruby 2.2.0dev
    * switch docs + website to olddoc
    * gemspec: fix bad reference to rdoc_options
    * README: reference yahns
    * build: fix quoting issue with double parens
    * response: avoid unnecessary args to IO.copy_stream
    * t/close-has-env.ru: ensure close is idempotent
    * sync_close: This fix breakage from Ruby-trunk r50118
    * t/t0044-autopush.sh: remove test
    * t/test_isolate.rb: updates for various gem versions
    * response: convert source arg to path before IO.copy_stream
    * speed up QUIT for users of the unicorn worker_loop
    * gemspec: use SPDX-compatible license for GPL-2.0+

* http://rainbows.bogomips.org/
* rainbows-public@bogomips.org
* http://bogomips.org/rainbows-public/
* git clone git://bogomips.org/rainbows.git
* http://rainbows.bogomips.org/NEWS.atom.xml

^ permalink raw reply	[relevance 4%]

* [PATCH v2] response: convert source arg to path before IO.copy_stream
  @ 2015-10-13 23:45  4% ` Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-10-13 23:45 UTC (permalink / raw)
  To: rainbows-public

This will allow us use the sendfile syscall under Linux on
Ruby which favor #read/#readpartial methods for non-IO objects.

This also allows us to revert changes made in
commit db790ff3531acdfa23ab290998bba29360a6782b
("sync_close: This fix breakage from Ruby-trunk r50118")
---
 lib/rainbows/response.rb   | 5 +++++
 lib/rainbows/sync_close.rb | 8 --------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb
index 8d0de1d..b7b6aa8 100644
--- a/lib/rainbows/response.rb
+++ b/lib/rainbows/response.rb
@@ -128,6 +128,11 @@ module Rainbows::Response
     unless IO.method_defined?(:trysendfile)
       module CopyStream
         def write_body_file(body, range)
+          # ensure sendfile gets used for SyncClose objects:
+          if !body.kind_of?(IO) && body.respond_to?(:to_path)
+            body = body.to_path
+          end
+
           range ? COPY_STREAM.copy_stream(body, self, range[1], range[0]) :
                   COPY_STREAM.copy_stream(body, self)
         end
diff --git a/lib/rainbows/sync_close.rb b/lib/rainbows/sync_close.rb
index 8738cae..999f003 100644
--- a/lib/rainbows/sync_close.rb
+++ b/lib/rainbows/sync_close.rb
@@ -16,14 +16,6 @@ class Rainbows::SyncClose
     @body.respond_to?(m)
   end
 
-  def readpartial(*args)
-    @body.readpartial(*args)
-  end
-
-  def read(*args)
-    @body.read(*args)
-  end
-
   def to_path
     @body.to_path
   end
-- 
EW


^ permalink raw reply related	[relevance 4%]

* [PATCH 4/6] sync_close: This fix breakage from Ruby-trunk r50118
  2015-09-14  5:33  4% [PATCH 0/6] misc updates for Ruby-trunk and gem changes Eric Wong
@ 2015-09-14  5:33  7% ` Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-09-14  5:33 UTC (permalink / raw)
  To: rainbows-public

By providing read+readpartial methods

IO.copy_stream behaves slightly differently when operating on
non-IO-subclassed objects nowadays.

Ref:
> * io.c (copy_stream_body): use the arguments without conversion if
>   having read, readpartial, and write methods, than conversion by
>   to_path method.  [ruby-core:68676] [Bug #11015]
---
 lib/rainbows/sync_close.rb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/rainbows/sync_close.rb b/lib/rainbows/sync_close.rb
index 75f119e..8738cae 100644
--- a/lib/rainbows/sync_close.rb
+++ b/lib/rainbows/sync_close.rb
@@ -16,6 +16,14 @@ class Rainbows::SyncClose
     @body.respond_to?(m)
   end
 
+  def readpartial(*args)
+    @body.readpartial(*args)
+  end
+
+  def read(*args)
+    @body.read(*args)
+  end
+
   def to_path
     @body.to_path
   end
@@ -31,7 +39,7 @@ class Rainbows::SyncClose
   # called by the writer thread to wake up the original thread (in #initialize)
   def close
     @body.close
-    ensure
-      @mutex.synchronize { @cv.signal }
+  ensure
+    @mutex.synchronize { @cv.signal }
   end
 end
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] misc updates for Ruby-trunk and gem changes
@ 2015-09-14  5:33  4% Eric Wong
  2015-09-14  5:33  7% ` [PATCH 4/6] sync_close: This fix breakage from Ruby-trunk r50118 Eric Wong
  0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2015-09-14  5:33 UTC (permalink / raw)
  To: rainbows-public

Ruby keeps changing, and so do gems (and I'm to blame for the
kgio change) which requires removing t0044.

Oh well.  Maybe I'll add MSG_MORE support to Rainbows! someday,
but yahns already supports it :)

Eric Wong (6):
      build: fix quoting issue with double parens
      response: avoid unnecessary args to IO.copy_stream
      t/close-has-env.ru: ensure close is idempotent
      sync_close: This fix breakage from Ruby-trunk r50118
      t/t0044-autopush.sh: remove test
      t/test_isolate.rb: updates for various gem versions

 lib/rainbows/response.rb   |   2 +-
 lib/rainbows/sync_close.rb |  12 ++++-
 t/GNUmakefile              |   2 +-
 t/close-has-env.ru         |   1 +
 t/t0044-autopush.sh        | 121 ---------------------------------------------
 t/test_isolate.rb          |  16 +++---
 6 files changed, 21 insertions(+), 133 deletions(-)


^ permalink raw reply	[relevance 4%]

Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-14  5:33  4% [PATCH 0/6] misc updates for Ruby-trunk and gem changes Eric Wong
2015-09-14  5:33  7% ` [PATCH 4/6] sync_close: This fix breakage from Ruby-trunk r50118 Eric Wong
2015-10-10  1:52     [PATCH] response: convert source arg to path before IO.copy_stream Eric Wong
2015-10-13 23:45  4% ` [PATCH v2] " Eric Wong
2015-10-19 21:28  4% [ANN] Rainbows! 4.7.0 - Rack HTTP server for the sleepy Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.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).