Young Hyun
2009-Dec-05 01:08 UTC
[Rev-talk] [PATCH] make openssl-nonblock more compatible with Ruby 1.9.2 preview 2
Here''s a small patch to make openssl-nonblock more compatible with Ruby 1.9.2 preview 2. Specifically, ReadAgain and WriteAgain now include IO::WaitReadable and IO::WaitWritable, respectively. This change allows a single code base to work with either Ruby 1.9.2 preview 2 or with openssl-nonblock on older Ruby versions. I''ve only tested this on ruby 1.8.7-p174. Rather than directly rescuing ReadAgain, one should rescue IO::WaitReadable (etc.) as described in the Ruby 1.9.2 preview 2 RDoc. --Young -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Changed-to-be-more-compatible-with-Ruby-1.9.2-previe.patch Type: application/octet-stream Size: 1859 bytes Desc: not available URL: <http://rubyforge.org/pipermail/rev-talk/attachments/20091204/26f3508e/attachment.obj> -------------- next part --------------
Tony Arcieri
2009-Dec-05 01:45 UTC
[Rev-talk] [PATCH] make openssl-nonblock more compatible with Ruby 1.9.2 preview 2
Thanks! Awhile ago I was asking Ruby Core about what the final names for these would be. Guess they''re decided now. I actually spun Rev''s OpenSSL nonblocking support off into its own gem: http://github.com/tarcieri/openssl-nonblock I''ve been meaning to switch Rev to depend on the openssl-nonblock gem (much in the way I spun off iobuffer into its own gem), and in fact the names of these exceptions were one of the things I was waiting on. This gem "monkeypatches" (in C code!) the Ruby SSL classes with nonblocking support. If I adjust the names of these exceptions in this gem, it should present an API which is fully compatible with Ruby 1.9.2 and is available to any application running on any other version of Ruby. I can make the same changes to this gem, or you can submit another patch, if you like. Given this development, I''d really like to switch Rev to use the openssl-nonblock gem. On Fri, Dec 4, 2009 at 6:08 PM, Young Hyun <youngh at caida.org> wrote:> Here''s a small patch to make openssl-nonblock more compatible with Ruby > 1.9.2 preview 2. Specifically, ReadAgain and WriteAgain now include > IO::WaitReadable and IO::WaitWritable, > respectively. This change allows a single code base to work with either > Ruby 1.9.2 preview 2 or with openssl-nonblock on older Ruby versions. I''ve > only tested this on ruby 1.8.7-p174. > > Rather than directly rescuing ReadAgain, one should rescue IO::WaitReadable > (etc.) as described in the Ruby 1.9.2 preview 2 RDoc. >-- Tony Arcieri Medioh/Nagravision -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rev-talk/attachments/20091204/38f6ee71/attachment.html>
Tony Arcieri
2009-Dec-16 05:12 UTC
[Rev-talk] [PATCH] make openssl-nonblock more compatible with Ruby 1.9.2 preview 2
Hi, I pushed your patch to github. I''ll try to release a new openssl-nonblock gem soon, but for now I''m having issues with Gemcutter. On Fri, Dec 4, 2009 at 6:45 PM, Tony Arcieri <tony at medioh.com> wrote:> Thanks! Awhile ago I was asking Ruby Core about what the final names for > these would be. Guess they''re decided now. > > I actually spun Rev''s OpenSSL nonblocking support off into its own gem: > > http://github.com/tarcieri/openssl-nonblock > > I''ve been meaning to switch Rev to depend on the openssl-nonblock gem (much > in the way I spun off iobuffer into its own gem), and in fact the names of > these exceptions were one of the things I was waiting on. This gem > "monkeypatches" (in C code!) the Ruby SSL classes with nonblocking support. > If I adjust the names of these exceptions in this gem, it should present an > API which is fully compatible with Ruby 1.9.2 and is available to any > application running on any other version of Ruby. > > I can make the same changes to this gem, or you can submit another patch, > if you like. Given this development, I''d really like to switch Rev to use > the openssl-nonblock gem. > > > On Fri, Dec 4, 2009 at 6:08 PM, Young Hyun <youngh at caida.org> wrote: > >> Here''s a small patch to make openssl-nonblock more compatible with Ruby >> 1.9.2 preview 2. Specifically, ReadAgain and WriteAgain now include >> IO::WaitReadable and IO::WaitWritable, >> respectively. This change allows a single code base to work with either >> Ruby 1.9.2 preview 2 or with openssl-nonblock on older Ruby versions. I''ve >> only tested this on ruby 1.8.7-p174. >> >> Rather than directly rescuing ReadAgain, one should rescue >> IO::WaitReadable (etc.) as described in the Ruby 1.9.2 preview 2 RDoc. >> > > -- > Tony Arcieri > Medioh/Nagravision >-- Tony Arcieri Medioh! A Kudelski Brand -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rev-talk/attachments/20091215/8fef60b4/attachment-0001.html>