Skip to content

Replace HTTPlib client with Curl #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
29052b3
include open ssl
Tmonster May 14, 2025
180bcb6
attempt to overwrite get
Tmonster May 15, 2025
303c9a7
compiles with curl now
Tmonster May 15, 2025
b8272b1
put head delete post get replaced
Tmonster May 16, 2025
e6c2780
bump duckdb
Tmonster May 16, 2025
2afdc88
remove extension stuff
Tmonster May 16, 2025
be81a80
install curl during build
Tmonster May 16, 2025
fdac277
run on ubuntu-latest
Tmonster May 16, 2025
ef581de
init vcpackage toolchain path
Tmonster May 16, 2025
e7bc7e0
actually add params to end of url for get requests
Tmonster May 16, 2025
b74abc2
get the response error message as well from the http response code he…
Tmonster May 16, 2025
88f96fc
remove all running httplib.hpp code
Tmonster May 16, 2025
04cb2a8
add back in state initialization
Tmonster May 16, 2025
02e8ac1
remove output result
Tmonster May 16, 2025
c92998c
add json read test
Tmonster May 16, 2025
fa93e10
add core extensions var
Tmonster May 16, 2025
499de90
always add headers, and set many more curl options on initialize
Tmonster May 16, 2025
9d8f71e
update extension ci tools
Tmonster May 16, 2025
e0cce43
fix test add comments
Tmonster May 19, 2025
9b90587
declare header object on heap not on stack
Tmonster May 20, 2025
5b3d988
also uniq string
Tmonster May 20, 2025
ccbf00a
some more debugging statements
Tmonster May 20, 2025
de6d606
move a lot of the request response info to the heap so it does not ge…
Tmonster May 20, 2025
0c167fd
this should work on the build now
Tmonster May 20, 2025
5d8d79f
more clean up
Tmonster May 20, 2025
d901fc4
Merge branch 'main' into use_curl_as_client
Tmonster May 20, 2025
0c42015
call curl_global_init, unsure when to call cleanup
Tmonster May 20, 2025
bd44ff2
remove verbose
Tmonster May 20, 2025
3da7bff
reuse many components
Tmonster May 21, 2025
198288e
add test to check response headers
Tmonster May 21, 2025
0f9f749
remove internal exception if certificate authority cannot be set
Tmonster May 21, 2025
73103b1
fix test
Tmonster May 21, 2025
afb0c2a
actually fix test
Tmonster May 21, 2025
4b32d40
remove rogue pragma
Tmonster May 21, 2025
37e253c
Merge branch 'main' into use_curl_as_client
Tmonster May 23, 2025
07a7afa
re-run CI for after release
Tmonster May 26, 2025
db6001f
Merge branch 'main' into use_curl_as_client
Tmonster Jun 17, 2025
3a93b42
update main distribution pipeline
Tmonster Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
with:
extension_name: httpfs
duckdb_version: v1.3.0
duckdb_version: v1.3.1
ci_tools_version: main

duckdb-stable-deploy:
Expand All @@ -27,6 +27,6 @@ jobs:
secrets: inherit
with:
extension_name: httpfs
duckdb_version: v1.3.0
duckdb_version: v1.3.1
ci_tools_version: main
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
4 changes: 3 additions & 1 deletion .github/workflows/MinioTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ defaults:
jobs:
minio-tests:
name: Minio Tests
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
env:
S3_TEST_SERVER_AVAILABLE: 1
AWS_DEFAULT_REGION: eu-west-1
AWS_ACCESS_KEY_ID: minio_duckdb_user
AWS_SECRET_ACCESS_KEY: minio_duckdb_user_password
DUCKDB_S3_ENDPOINT: duckdb-minio.com:9000
DUCKDB_S3_USE_SSL: false
CORE_EXTENSIONS: 'parquet;json'
GEN: ninja
VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
VCPKG_TARGET_TRIPLET: x64-linux

steps:
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,29 @@ if(MINGW)
endif()

find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${CURL_INCLUDE_DIRS})
if(EMSCRIPTEN)

else()
target_link_libraries(httpfs_loadable_extension duckdb_mbedtls
${OPENSSL_LIBRARIES})
target_link_libraries(httpfs_extension duckdb_mbedtls ${OPENSSL_LIBRARIES})

# Link dependencies into extension
target_link_libraries(httpfs_loadable_extension ${CURL_LIBRARIES})
target_link_libraries(httpfs_extension ${CURL_LIBRARIES})


if(MINGW)
find_package(ZLIB)
target_link_libraries(httpfs_loadable_extension ZLIB::ZLIB -lcrypt32)
target_link_libraries(httpfs_extension ZLIB::ZLIB -lcrypt32)
endif()
endif()


install(
TARGETS httpfs_extension
EXPORT "${DUCKDB_EXPORT_SET}"
Expand Down
11 changes: 10 additions & 1 deletion extension/httpfs/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
#include <stdio.h>

#define CPPHTTPLIB_OPENSSL_SUPPORT
#include "httplib.hpp"

#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
#include <openssl/rand.h>

#if defined(_WIN32) && defined(OPENSSL_USE_APPLINK)
#include <openssl/applink.c>
#endif

namespace duckdb {

Expand Down
Loading
Loading