From b15c07643e223dc4f8f94f9681836a9c1bf3af06 Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Mon, 23 Sep 2019 11:56:49 -0700 Subject: [PATCH] Http API change + update to CRT v0.5.4 (#62) --- aws-common-runtime/CMakeLists.txt | 2 +- codebuild/common-posix.sh | 2 +- codebuild/common-windows.bat | 2 +- discovery/source/DiscoveryClient.cpp | 10 ++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/aws-common-runtime/CMakeLists.txt b/aws-common-runtime/CMakeLists.txt index dd2ab3fa6..c946327e6 100644 --- a/aws-common-runtime/CMakeLists.txt +++ b/aws-common-runtime/CMakeLists.txt @@ -18,5 +18,5 @@ set(AWS_DEPS_DOWNLOAD_DIR "${AWS_DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependen message("install dir ${AWS_DEPS_INSTALL_DIR}") set(AWS_CRT_CPP_URL "https://github.com/awslabs/aws-crt-cpp.git") -set(AWS_CRT_CPP_SHA "v0.5.3") +set(AWS_CRT_CPP_SHA "v0.5.4") include(BuildAwsCrtCpp) diff --git a/codebuild/common-posix.sh b/codebuild/common-posix.sh index a63dda48b..b407c5619 100755 --- a/codebuild/common-posix.sh +++ b/codebuild/common-posix.sh @@ -17,7 +17,7 @@ fi # build aws-crt-cpp pushd $BUILD_PATH -git clone --branch v0.5.3 https://github.com/awslabs/aws-crt-cpp.git +git clone --branch v0.5.4 https://github.com/awslabs/aws-crt-cpp.git cd aws-crt-cpp cmake $CMAKE_ARGS -DBUILD_DEPS=ON ./ cmake --build . --target install diff --git a/codebuild/common-windows.bat b/codebuild/common-windows.bat index 877242ed4..a80681fd4 100755 --- a/codebuild/common-windows.bat +++ b/codebuild/common-windows.bat @@ -8,7 +8,7 @@ mkdir %INSTALL_DIR% @rem build aws-crt-cpp mkdir %BUILDS_DIR%\aws-crt-cpp-build cd %BUILDS_DIR%\aws-crt-cpp-build -git clone --branch v0.5.3 https://github.com/awslabs/aws-crt-cpp.git +git clone --branch v0.5.4 https://github.com/awslabs/aws-crt-cpp.git cmake %CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%" -DCMAKE_PREFIX_PATH="%INSTALL_DIR%" -DCMAKE_BUILD_TYPE="Release" -DBUILD_DEPS=ON aws-crt-cpp || goto error cmake --build . --target install || goto error diff --git a/discovery/source/DiscoveryClient.cpp b/discovery/source/DiscoveryClient.cpp index 180b2357c..10957722e 100644 --- a/discovery/source/DiscoveryClient.cpp +++ b/discovery/source/DiscoveryClient.cpp @@ -152,10 +152,12 @@ namespace Aws Crt::Http::HttpRequestOptions requestOptions; requestOptions.request = request.get(); requestOptions.onIncomingHeaders = - [](Crt::Http::HttpStream &, const Crt::Http::HttpHeader *, std::size_t) {}; - requestOptions.onIncomingHeadersBlockDone = [callbackContext](Crt::Http::HttpStream &stream, bool) { - callbackContext->responseCode = stream.GetResponseStatusCode(); - }; + [](Crt::Http::HttpStream &, aws_http_header_block, const Crt::Http::HttpHeader *, std::size_t) { + }; + requestOptions.onIncomingHeadersBlockDone = + [callbackContext](Crt::Http::HttpStream &stream, aws_http_header_block) { + callbackContext->responseCode = stream.GetResponseStatusCode(); + }; requestOptions.onIncomingBody = [callbackContext](Crt::Http::HttpStream &, const Crt::ByteCursor &data) { callbackContext->ss.write(reinterpret_cast(data.ptr), data.len);