Mark,

On 6/22/15 9:44 AM, ma...@apache.org wrote:
> Author: markt
> Date: Mon Jun 22 13:44:35 2015
> New Revision: 1686871
> 
> URL: http://svn.apache.org/r1686871
> Log:
> Align constants with tc-native trunk
> 
> Modified:
>     tomcat/trunk/java/org/apache/tomcat/jni/SSL.java
> 
> Modified: tomcat/trunk/java/org/apache/tomcat/jni/SSL.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/SSL.java?rev=1686871&r1=1686870&r2=1686871&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/jni/SSL.java (original)
> +++ tomcat/trunk/java/org/apache/tomcat/jni/SSL.java Mon Jun 22 13:44:35 2015
> @@ -36,7 +36,8 @@ public final class SSL {
>  
>      public static final int SSL_AIDX_RSA     = 0;
>      public static final int SSL_AIDX_DSA     = 1;
> -    public static final int SSL_AIDX_MAX     = 2;
> +    public static final int SSL_AIDX_ECC     = 3;
> +    public static final int SSL_AIDX_MAX     = 4;

This is an odd definition (though it is consistent with its previous
definition). The moniker "_MAX" suggests that it is the maximum value
that SSL_AIDX_[whatever] ought to have, which is currently 3 (ignoring
SSL_AIDX_MAX itself).

The constant SSL_AIDX_MAX will then only be useful when performing a
comparison like this:

  if ( SSL_AIDX_MIN <= sslAidx && sslAidx < SSL_AIDX_MAX )

Note the use of < instead of <=, which would typically used in an when a
"max value" would be checked. This is more like a maximum index than a
maximum value, and it's not clear from the constant name what it's for.

Perhaps SSL_AIDX_ARRAY_LENGTH=4 would make more sense, or even
SSL_AIDX_MAX_INDEX=4.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to