Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatched JNI call on proxy auth enum #779

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/native/java_class_ids.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,19 @@ static void s_cache_http_proxy_connection_type(JNIEnv *env) {
AWS_FATAL_ASSERT(http_proxy_connection_type_properties.proxy_get_value_id);
}

struct java_aws_http_proxy_authorization_type_properties http_proxy_authorization_type_properties;

static void s_cache_http_proxy_authorization_type(JNIEnv *env) {
jclass cls = (*env)->FindClass(env, "software/amazon/awssdk/crt/http/HttpProxyOptions$HttpProxyAuthorizationType");
AWS_FATAL_ASSERT(cls);
http_proxy_authorization_type_properties.http_proxy_authorization_type_class = (*env)->NewGlobalRef(env, cls);
AWS_FATAL_ASSERT(http_proxy_authorization_type_properties.http_proxy_authorization_type_class);
// Functions
http_proxy_authorization_type_properties.proxy_get_value_id = (*env)->GetMethodID(
env, http_proxy_authorization_type_properties.http_proxy_authorization_type_class, "getValue", "()I");
AWS_FATAL_ASSERT(http_proxy_authorization_type_properties.proxy_get_value_id);
}

struct java_aws_mqtt5_client_options_properties mqtt5_client_options_properties;

static void s_cache_mqtt5_client_options(JNIEnv *env) {
Expand Down Expand Up @@ -2372,6 +2385,7 @@ static void s_cache_java_class_ids(void *user_data) {
s_cache_mqtt5_negotiated_settings(env);
s_cache_http_proxy_options(env);
s_cache_http_proxy_connection_type(env);
s_cache_http_proxy_authorization_type(env);
s_cache_mqtt5_client_options(env);
s_cache_mqtt5_client_properties(env);
s_cache_mqtt5_client_operation_statistics_properties(env);
Expand Down
7 changes: 7 additions & 0 deletions src/native/java_class_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,13 @@ struct java_aws_http_proxy_connection_type_properties {
};
extern struct java_aws_http_proxy_connection_type_properties http_proxy_connection_type_properties;

/* http.HttpProxyOptions.HttpProxyAuthorizationType */
struct java_aws_http_proxy_authorization_type_properties {
jclass http_proxy_authorization_type_class;
jmethodID proxy_get_value_id;
};
extern struct java_aws_http_proxy_authorization_type_properties http_proxy_authorization_type_properties;

/* mqtt5.ClientOptions */
struct java_aws_mqtt5_client_options_properties {
jclass client_options_class;
Expand Down
2 changes: 1 addition & 1 deletion src/native/mqtt5_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static struct aws_http_proxy_options_java_jni *s_aws_mqtt5_http_proxy_options_cr
}
if (jni_proxy_authorization_type) {
jint jni_proxy_authorization_type_value = (*env)->CallIntMethod(
env, jni_proxy_authorization_type, http_proxy_connection_type_properties.proxy_get_value_id);
env, jni_proxy_authorization_type, http_proxy_authorization_type_properties.proxy_get_value_id);
if (aws_jni_check_and_clear_exception(env)) {
goto on_error;
}
Expand Down
Loading