|
38 | 38 | import org.jruby.runtime.Block;
|
39 | 39 | import org.jruby.runtime.ThreadContext;
|
40 | 40 | import org.jruby.runtime.builtin.IRubyObject;
|
| 41 | +import org.jruby.util.SafePropertyAccessor; |
41 | 42 |
|
42 | 43 | /**
|
43 | 44 | * @author <a href="mailto:[email protected]">Ola Bini</a>
|
@@ -177,13 +178,20 @@ public static RaiseException newSSLErrorWaitWritable(Ruby runtime, String messag
|
177 | 178 | return newCustomSSLError(runtime, "SSLErrorWaitWritable", message);
|
178 | 179 | }
|
179 | 180 |
|
| 181 | + // -Djruby.openssl.ssl.error_wait_nonblock.backtrace=false disables backtrace for WaitReadable/Writable |
| 182 | + private static final boolean waitErrorBacktrace = |
| 183 | + SafePropertyAccessor.getBoolean("jruby.openssl.ssl.error_wait_nonblock.backtrace", false); |
| 184 | + |
180 | 185 | private static RaiseException newCustomSSLError(final Ruby runtime, final String name,
|
181 | 186 | final String message) {
|
182 | 187 | RubyClass errorClass = _SSL(runtime).getClass(name);
|
183 | 188 | if ( errorClass == null ) { // < Ruby 2.0
|
184 | 189 | errorClass = _SSL(runtime).getClass("SSLError"); // fallback
|
185 | 190 | }
|
186 |
| - return Utils.newError(runtime, errorClass, message, false); |
| 191 | + if ( waitErrorBacktrace ) { |
| 192 | + return Utils.newError(runtime, errorClass, message, false); |
| 193 | + } |
| 194 | + return Utils.newErrorWithoutTrace(runtime, errorClass, message, false); |
187 | 195 | }
|
188 | 196 |
|
189 | 197 | static RubyModule _SSL(final Ruby runtime) {
|
|
0 commit comments