ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:74051] [Ruby trunk Bug#12126] [PATCH] openssl: accept moving write buffer for write_nonblock
       [not found] <redmine.issue-12126.20160229130252@ruby-lang.org>
@ 2016-02-29 13:02 ` normalperson
  2016-03-01  1:37   ` [ruby-core:74069] " Eric Wong
  2016-03-17  7:00 ` [ruby-core:74400] " shyouhei
  1 sibling, 1 reply; 3+ messages in thread
From: normalperson @ 2016-02-29 13:02 UTC (permalink / raw
  To: ruby-core

Issue #12126 has been reported by Eric Wong.

----------------------------------------
Bug #12126: [PATCH] openssl: accept moving write buffer for write_nonblock
https://bugs.ruby-lang.org/issues/12126

* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
~~~
By setting the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag.
This flag was introduced at the same time as
SSL_MODE_ENABLE_PARTIAL_WRITE in OpenSSL 0.9.4 and makes usage
with non-blocking sockets much easier.

Before this, a Rubyist would need to remember the exact object
which failed to write and reuse it later when the socket became
writable again.  This causes problems when the buffer is given
by another layer of the application (e.g. a buffer is given
by a Rack middleware or application to a Rack web server).

* ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc):
  enable SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER by default
~~~

Related to https://bugs.ruby-lang.org/issues/12085

I'm not sure if this can be considered a bugfix which
should be backported.  I have found write_nonblock usability to
be severely hampered by the lack if this flag.


---Files--------------------------------
0001-openssl-accept-moving-write-buffer-for-write_nonbloc.patch (2.53 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:74069] Re: [Ruby trunk Bug#12126] [PATCH] openssl: accept moving write buffer for write_nonblock
  2016-02-29 13:02 ` [ruby-core:74051] [Ruby trunk Bug#12126] [PATCH] openssl: accept moving write buffer for write_nonblock normalperson
@ 2016-03-01  1:37   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-03-01  1:37 UTC (permalink / raw
  To: ruby-core

normalperson@yhbt.net wrote:
> Before this, a Rubyist would need to remember the exact object
> which failed to write and reuse it later when the socket became
> writable again.  This causes problems when the buffer is given
> by another layer of the application (e.g. a buffer is given
> by a Rack middleware or application to a Rack web server).

I should note the content of the buffer still needs to remain the
unchanged.  And IMHO, any reasonable non-blocking server working with
stream sockets is expected to maintain identical content when
retrying writes.

The main difference with this patch is the memory addresses passed
to SSL_write() C function can be safely changed when retrying.
IMHO it's unreasonable for a Ruby programmer to care about memory
addresses passed to C functions when writing in Ruby.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:74400] [Ruby trunk Bug#12126] [PATCH] openssl: accept moving write buffer for write_nonblock
       [not found] <redmine.issue-12126.20160229130252@ruby-lang.org>
  2016-02-29 13:02 ` [ruby-core:74051] [Ruby trunk Bug#12126] [PATCH] openssl: accept moving write buffer for write_nonblock normalperson
@ 2016-03-17  7:00 ` shyouhei
  1 sibling, 0 replies; 3+ messages in thread
From: shyouhei @ 2016-03-17  7:00 UTC (permalink / raw
  To: ruby-core

Issue #12126 has been updated by Shyouhei Urabe.


No objection.

----------------------------------------
Bug #12126: [PATCH] openssl: accept moving write buffer for write_nonblock
https://bugs.ruby-lang.org/issues/12126#change-57524

* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
~~~
By setting the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag.
This flag was introduced at the same time as
SSL_MODE_ENABLE_PARTIAL_WRITE in OpenSSL 0.9.4 and makes usage
with non-blocking sockets much easier.

Before this, a Rubyist would need to remember the exact object
which failed to write and reuse it later when the socket became
writable again.  This causes problems when the buffer is given
by another layer of the application (e.g. a buffer is given
by a Rack middleware or application to a Rack web server).

* ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc):
  enable SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER by default
~~~

Related to https://bugs.ruby-lang.org/issues/12085

I'm not sure if this can be considered a bugfix which
should be backported.  I have found write_nonblock usability to
be severely hampered by the lack if this flag.


---Files--------------------------------
0001-openssl-accept-moving-write-buffer-for-write_nonbloc.patch (2.53 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-17  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-12126.20160229130252@ruby-lang.org>
2016-02-29 13:02 ` [ruby-core:74051] [Ruby trunk Bug#12126] [PATCH] openssl: accept moving write buffer for write_nonblock normalperson
2016-03-01  1:37   ` [ruby-core:74069] " Eric Wong
2016-03-17  7:00 ` [ruby-core:74400] " shyouhei

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).