Skip to content

Commit

Permalink
Merge branch 'main' into maxday/add-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxday authored Jul 29, 2024
2 parents f711f82 + c5e2ee3 commit cadd36b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public LambdaRuntimeApiClientImpl(String hostnameAndPort) {
Objects.requireNonNull(hostnameAndPort, "hostnameAndPort cannot be null");
this.baseUrl = "http://" + hostnameAndPort;
this.invocationEndpoint = this.baseUrl + "/2018-06-01/runtime/invocation/";
NativeClient.init();
NativeClient.init(hostnameAndPort);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* interactions with the Runtime API.
*/
class NativeClient {
static void init() {
static void init(String awsLambdaRuntimeApi) {
JniHelper.load();
initializeClient(USER_AGENT.getBytes());
initializeClient(USER_AGENT.getBytes(), awsLambdaRuntimeApi.getBytes());
}

static native void initializeClient(byte[] userAgent);
static native void initializeClient(byte[] userAgent, byte[] awsLambdaRuntimeApi);

static native InvocationRequest next();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static std::string toNativeString(JNIEnv *env, jbyteArray jArray) {
return nativeString;
}

JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_initializeClient(JNIEnv *env, jobject thisObject, jbyteArray userAgent) {
JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_initializeClient(JNIEnv *env, jobject thisObject, jbyteArray userAgent, jbyteArray awsLambdaRuntimeApi) {
std::string user_agent = toNativeString(env, userAgent);
std::string endpoint(getenv("AWS_LAMBDA_RUNTIME_API"));
std::string endpoint = toNativeString(env, awsLambdaRuntimeApi);
CLIENT = new aws::lambda_runtime::runtime(endpoint, user_agent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
#endif

JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_initializeClient
(JNIEnv *, jobject, jbyteArray);
(JNIEnv *, jobject, jbyteArray, jbyteArray);

JNIEXPORT jobject JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_next
(JNIEnv *, jobject);
Expand Down

0 comments on commit cadd36b

Please sign in to comment.