Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
peterychang committed Feb 8, 2024
1 parent cb7fb61 commit ec2f546
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
2 changes: 2 additions & 0 deletions examples/rl_sim_cpp/azure_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ int AzureCredentials::get_credentials(
std::cout << "Unknown error while getting auth token";
return error_code::external_error;
}
# else
# error Requires C++14 or greater
# endif
return error_code::success;
}
Expand Down
11 changes: 0 additions & 11 deletions rlclientlib/logger/http_transport_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,6 @@ pplx::task<http_response> http_transport_client<TAuthorization>::http_request_ta
utility::stl_container_adapter container(_post_data.get());
const size_t container_size = container.size();

/*
std::string payload((char*)(container.begin()), container_size);
std::string body = "{Body\":\"";
body += payload;
body += "\"}";
std::cout << body << std::endl << std::endl;
const auto stream = concurrency::streams::bytestream::open_istream(body);
request.set_body(stream, body.size());
*/
const auto stream = concurrency::streams::bytestream::open_istream(container);
request.set_body(stream, container_size);

Expand Down
6 changes: 3 additions & 3 deletions rlclientlib/model_mgmt/restapi_data_transport_oauth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int restapi_data_transport_oauth::get_data_info(
{
// Get request URI and start the request.
http_request request(_method_type);
RETURN_IF_FAIL(add_authentiction_header(request.headers(), status));
RETURN_IF_FAIL(add_authentication_header(request.headers(), status));
// Build request URI and start the request.
auto request_task = _httpcli->request(request).then(
[&](http_response response)
Expand Down Expand Up @@ -111,7 +111,7 @@ int restapi_data_transport_oauth::get_data_info(
}
}

int restapi_data_transport_oauth::add_authentiction_header(http_headers& header, api_status* status)
int restapi_data_transport_oauth::add_authentication_header(http_headers& header, api_status* status)
{
if (_model_source != model_source::AZURE)
{
Expand All @@ -132,7 +132,7 @@ int restapi_data_transport_oauth::get_data(model_data& ret, api_status* status)
if (curr_last_modified == _last_modified && curr_datasz == _datasz) { return error_code::success; }
_method_type = methods::GET;
http_request request(_method_type);
RETURN_IF_FAIL(add_authentiction_header(request.headers(), status));
RETURN_IF_FAIL(add_authentication_header(request.headers(), status));
// Build request URI and start the request.
auto request_task =
_httpcli
Expand Down
2 changes: 1 addition & 1 deletion rlclientlib/model_mgmt/restapi_data_transport_oauth.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class restapi_data_transport_oauth : public i_data_transport
private:
using time_t = std::chrono::time_point<std::chrono::system_clock>;
int get_data_info(::utility::datetime& last_modified, ::utility::size64_t& sz, api_status* status);
int add_authentiction_header(http_headers& header, api_status* status);
int add_authentication_header(http_headers& header, api_status* status);
std::unique_ptr<i_http_client> _httpcli;
::utility::datetime _last_modified;
uint64_t _datasz;
Expand Down

0 comments on commit ec2f546

Please sign in to comment.