Skip to content

Commit

Permalink
feat(asio): Drop esp/asio patches in favor of sock-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Dec 18, 2024
1 parent 42cde46 commit cba5047
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "components/asio/asio"]
path = components/asio/asio
url = https://github.com/espressif/asio
url = https://github.com/chriskohlhoff/asio
[submodule "components/mosquitto/mosquitto"]
path = components/mosquitto/mosquitto
url = https://github.com/eclipse/mosquitto
6 changes: 3 additions & 3 deletions components/asio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION)
return()
endif()

set(asio_sources "asio/asio/src/asio.cpp")
set(asio_requires lwip)
set(asio_sources "asio/asio/src/asio.cpp" "port/src/asio_stub.cpp")
set(asio_requires lwip sock_utils)

if(CONFIG_ASIO_SSL_SUPPORT)
list(APPEND asio_sources
Expand All @@ -18,7 +18,7 @@ if(CONFIG_ASIO_SSL_SUPPORT)
endif()

idf_component_register(SRCS ${asio_sources}
INCLUDE_DIRS "asio/asio/include" "port/include"
INCLUDE_DIRS "port/include" "asio/asio/include"
PRIV_INCLUDE_DIRS ${asio_priv_includes}
PRIV_REQUIRES ${asio_requires})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dependencies:
override_path: "../../../"
protocol_examples_common:
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
espressif/sock_utils: "*"
11 changes: 11 additions & 0 deletions components/asio/port/include/asio/detail/config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

#include "sys/socket.h"
#include "socketpair.h"

#include_next "asio/detail/config.hpp"
12 changes: 0 additions & 12 deletions components/asio/port/include/esp_asio_config.h

This file was deleted.

2 changes: 1 addition & 1 deletion components/asio/port/mbedtls/src/mbedtls_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//

#include "asio/detail/config.hpp"
#include "openssl_stub.hpp"
#include "asio/ssl/detail/openssl_types.hpp"
#include <cstring>
#include "asio/detail/throw_error.hpp"
#include "asio/error.hpp"
Expand Down
2 changes: 1 addition & 1 deletion components/asio/port/mbedtls/src/mbedtls_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#include "asio/detail/config.hpp"
#include "openssl_stub.hpp"
#include "asio/ssl/detail/openssl_types.hpp"
#include "asio/detail/throw_error.hpp"
#include "asio/error.hpp"
#include "asio/ssl/detail/engine.hpp"
Expand Down
14 changes: 14 additions & 0 deletions components/asio/port/src/asio_stub.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
//
// SPDX-License-Identifier: Apache-2.0
//
#include <unistd.h>
#include <climits>

extern "C" int pause (void)
{
while (true) {
::sleep(UINT_MAX);
}
}

0 comments on commit cba5047

Please sign in to comment.