From 232b0eda5fc97ece0ed32028c013635846fed435 Mon Sep 17 00:00:00 2001 From: Euripedes Rocha Date: Wed, 13 Apr 2022 11:22:34 -0300 Subject: [PATCH] [EXAMPLES/ASIO] Renames Kconfig parameter and clarify On ip::tcp::resolver ASIO uses service to identify the type of connection and get the port number. LWIP can't resolve this way. --- examples/protocols/asio/socks4/main/Kconfig.projbuild | 8 ++++---- examples/protocols/asio/socks4/main/socks4.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/protocols/asio/socks4/main/Kconfig.projbuild b/examples/protocols/asio/socks4/main/Kconfig.projbuild index 984b2f20fa..69dd024cda 100644 --- a/examples/protocols/asio/socks4/main/Kconfig.projbuild +++ b/examples/protocols/asio/socks4/main/Kconfig.projbuild @@ -6,11 +6,11 @@ menu "Example Configuration" help Address of the proxy to be used. - config EXAMPLE_PROXY_PORT - string "Proxy port" + config EXAMPLE_PROXY_SERVICE + string "Proxy Service Type" default "myport" help - Port for the proxy. Due to a limitation of lwip, must - be a number e.g. "1080". + Service type. Due to a limitation of lwip, must + be the port number e.g. "1080". endmenu diff --git a/examples/protocols/asio/socks4/main/socks4.cpp b/examples/protocols/asio/socks4/main/socks4.cpp index b03d788080..5bd0011ed4 100644 --- a/examples/protocols/asio/socks4/main/socks4.cpp +++ b/examples/protocols/asio/socks4/main/socks4.cpp @@ -378,7 +378,7 @@ extern "C" void app_main(void) asio::io_context io_context; Http::Request request(Http::Method::GET, "www.httpbin.org", "80", "/get"); - Socks::async_connect(io_context, CONFIG_EXAMPLE_PROXY_ADDRESS, CONFIG_EXAMPLE_PROXY_PORT, request.host(), request.service_port(), + Socks::async_connect(io_context, CONFIG_EXAMPLE_PROXY_ADDRESS, CONFIG_EXAMPLE_PROXY_SERVICE, request.host(), request.service_port(), [&request](std::shared_ptr connection) { // Now we create a HTTP::Session and inject the necessary connection. std::make_shared(connection)->send_request(request, [](std::shared_ptr session, Http::Response response) {