Project

General

Profile

Feature #12085

[PATCH] openssl: document `exception: false' for *_nonblock

Added by normalperson (Eric Wong) over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:73882]

Description

  • ext/openssl/lib/openssl/buffering.rb (read_nonblock, write_nonblock): document `exception: false'

Updated v2 patch since [Bug #12126] is split out.
Also updated for read_nonblock.


Files


Related issues

Related to Ruby master - Bug #12126: [PATCH] openssl: accept moving write buffer for write_nonblockClosedActions

History

Updated by normalperson (Eric Wong) over 3 years ago

normalperson@yhbt.net wrote:

I do not plan to commit the test change since OpenSSL behavior
may be improved in the future.

I just discovered SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER,
which might've saved me plenty of headaches earlier this month:

--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -145,7 +145,8 @@ static VALUE
 ossl_sslctx_s_alloc(VALUE klass)
 {
     SSL_CTX *ctx;
-    long mode = SSL_MODE_ENABLE_PARTIAL_WRITE;
+    long mode = SSL_MODE_ENABLE_PARTIAL_WRITE |
+   SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
     VALUE obj;

 #ifdef SSL_MODE_RELEASE_BUFFERS

This flag is documented in SSL_CTX_set_mode(3SSL) and has been around
since SSL_MODE_ENABLE_PARTIAL_WRITE was introduced.

I haven't tested the effects of this flag, yet, as I've already worked
around the lack of this flag in a project which uses the OpenSSL
extension.

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Description updated (diff)

Updated by normalperson (Eric Wong) over 3 years ago

Updated by hsbt (Hiroshi SHIBATA) over 3 years ago

  • Assignee changed from zzak (Zachary Scott) to rhenium (Kazuki Yamaguchi)
  • Status changed from Open to Assigned

rhenium

Can you review (and apply) this?

#5

Updated by naruse (Yui NARUSE) over 3 years ago

  • Related to Bug #12126: [PATCH] openssl: accept moving write buffer for write_nonblock added

Updated by rhenium (Kazuki Yamaguchi) almost 3 years ago

  • Status changed from Assigned to Closed

Applied as 5c31e7233476 at the new repository:

https://github.com/ruby/openssl/commit/5c31e7233476bec184cac239b5d36de68dbd997e

and is already imported to trunk as a part of openssl v2.0.0.

Also available in: Atom PDF