Repository navigation
Allow to use different sizes for both BIO buffers. - #210
normanmaurer wants to merge 1 commit into
Conversation
nmittler
left a comment
There was a problem hiding this comment.
@normanmaurer is this an API-breaking change?
|
@nmittler nope as the old java methods are still there. Only the native method changed and new java methods were added. |
| } | ||
|
|
||
| TCN_IMPLEMENT_CALL(jlong, SSL, makeNetworkBIO)(TCN_STDARGS, jlong ssl) { | ||
| TCN_IMPLEMENT_CALL(jlong, SSL, makeNetworkBIO)(TCN_STDARGS, jlong ssl, jint max_bio_size1, jint max_bio_size2) { |
There was a problem hiding this comment.
max_bio_size1 -> maxInternalBIOSize
max_bio_size2 -> maxNetworkBIOSize
| * the provided SSL instance, you must call freeBIO on the returned network BIO. | ||
| * | ||
| * @param ssl the SSL instance (SSL *) | ||
| * @param maxInternalBIOSize The maximum size of the BIO. Pass 0 to use the default max size. |
There was a problem hiding this comment.
clarify that this BIO is on the application side. also do the same for the network BIO. Add a link to https://www.openssl.org/docs/man1.0.1/crypto/BIO_s_bio.html (see the example section)
|
|
||
| if (max_bio_size < 0) { | ||
| tcn_ThrowException(e, "max_bio_size < 0"); | ||
| if (maxInternalBIOSize < 0) { |
There was a problem hiding this comment.
nit: most of the time this will not be violated ... I wonder if we can just reduce the amount of conditionals and combine the precondition check into a single conditional:
if (maxInternalBIOSize < 0 || maxNetworkBIOSize < 0) {
tcn_ThrowException(e, "maxInternalBIOSize and maxNetworkBIOSize both must be >= 0");
return 0;
}There was a problem hiding this comment.
@Scottmitch let us just keep it as it is as this one will be called only very infrequently anyway.
Motivation: e691680 introduced a new method that allowed to set the BIO buffer size but this size is used for both buffers while sometimes different sizes can make sense. Modifications: Add new method that take two different buffer sizes. Result: More flexible way of creating network BIOs.
8659829 to
c542258
Compare
|
@Scottmitch PTAL again |
Motivation:
e691680 introduced a new method that allowed to set the BIO buffer size but this size is used for both buffers while sometimes different sizes can make sense.
Modifications:
Add new method that take two different buffer sizes.
Result:
More flexible way of creating network BIOs.