Skip to content

Commit e05ef04

Browse files
achamayouCopilot
andauthored
Move libcurl/libuv HTTP client into acyclic http_client component
Move src/http/curl.h to src/http_client/curl.h, and src/http/test/curl_test.cpp to src/http_client/test/curl_test.cpp, updating all in-tree includes and the CMake registration. No forwarding header is left at the old path since curl.h is an internal header. Narrow the http component's declared internal dependencies to [ccf-api, crypto, ds] now that the libuv-dependent client code has moved out, and add the new http_client component with [ccf-api, ds, uv]. This keeps http protocol-focused and acyclic, and keeps the new http_client component acyclic and outside the cyclic core. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f62f38d commit e05ef04

11 files changed

Lines changed: 11 additions & 10 deletions

File tree

.github/instructions/reviewing.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Use this to verify that the correct check macro is used and that the error path
5858

5959
## libcurl
6060

61-
CCF wraps libcurl in `src/http/curl.h`.
61+
CCF wraps libcurl in `src/http_client/curl.h`.
6262

6363
| Macro | Use when … |
6464
| -------------------------------------------- | ----------------------------------- |

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ if(BUILD_TESTS)
15991599

16001600
add_test_bin(
16011601
curl_test
1602-
${CMAKE_CURRENT_SOURCE_DIR}/src/http/test/curl_test.cpp
1602+
${CMAKE_CURRENT_SOURCE_DIR}/src/http_client/test/curl_test.cpp
16031603
)
16041604
target_link_libraries(curl_test PRIVATE curl uv http_parser)
16051605

scripts/source-dependencies.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"tls": ["crypto", "ds"],
3535
"udp": ["ds"],
3636
"uv": [],
37-
"http": ["ccf-api", "crypto", "ds", "uv"]
37+
"http": ["ccf-api", "crypto", "ds"],
38+
"http_client": ["ccf-api", "ds", "uv"]
3839
}
3940
}

src/host/run.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "handle_ring_buffer.h"
3333
#include "host/env.h"
3434
#include "host/files_cleanup_timer.h"
35-
#include "http/curl.h"
35+
#include "http_client/curl.h"
3636
#include "json_schema.h"
3737
#include "lfs_file_handler.h"
3838
#include "node_connections.h"
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "ccf/ds/json.h"
55
#include "curl/curl.h"
66
#include "ds/internal_logger.h"
7-
#include "http/curl.h"
7+
#include "http_client/curl.h"
88

99
#include <cstdlib>
1010
#include <curl/header.h>

src/node/jwt_key_auto_refresh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include "ccf/ds/nonstd.h"
77
#include "ccf/service/tables/jwt.h"
88
#include "enclave/http_rpc_context.h"
9-
#include "http/curl.h"
109
#include "http/http_builder.h"
10+
#include "http_client/curl.h"
1111
#include "node/rpc/node_frontend.h"
1212
#include "tasks/basic_task.h"
1313
#include "tasks/task_system.h"

src/node/node_state.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#include "enclave/rpc_sessions.h"
3131
#include "encryptor.h"
3232
#include "history.h"
33-
#include "http/curl.h"
3433
#include "http/http_parser.h"
34+
#include "http_client/curl.h"
3535
#include "indexing/indexer.h"
3636
#include "js/global_class_ids.h"
3737
#include "network_state.h"

src/node/quote_endorsements_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "ccf/http_consts.h"
99
#include "ccf/pal/attestation.h"
1010
#include "ccf/pal/attestation_sev_snp_endorsements.h"
11-
#include "http/curl.h"
11+
#include "http_client/curl.h"
1212
#include "tasks/basic_task.h"
1313
#include "tasks/task.h"
1414
#include "tasks/task_system.h"

src/node/recovery_decision_protocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "ccf/service/tables/self_healing_open.h"
1010
#include "ccf/tx.h"
1111
#include "ccf/tx_id.h"
12-
#include "http/curl.h"
12+
#include "http_client/curl.h"
1313
#include "node_state.h"
1414
#include "tasks/basic_task.h"
1515
#include "tasks/task_system.h"

0 commit comments

Comments
 (0)