You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by ro...@apache.org on 2026/08/25 13:52:55 UTC
(axis-axis2-c-core) 01/08: Drop docs for the removed libcurl backend and leak
This is an automated email from the ASF dual-hosted git repository.
robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-c-core.git
commit 37fcfebfe5659c7a6b26be1cfde3912eff417a87
Author: Robert Lazarski <ro...@gmail.com>
AuthorDate: Tue Aug 25 03:23:03 2026 -1000
Drop docs for the removed libcurl backend and leak
The libcurl backend went before 2.0.0, but the userguide still
installed libcurl4-openssl-dev and passed --enable-libcurl, which
configure no longer accepts. The known-limitations page described a
connection-map leak that AXIS2C-1632 fixed, at a line past the end of
the file.
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
---
docs/HTTP11_SOAP_HTTP_CLIENT_C.md | 23 ------
docs/guide/known-limitations.md | 128 ------------------------------
docs/userguide/deploy-localhost.sh | 2 +-
docs/userguide/json-httpd-h2-userguide.md | 5 --
mkdocs.yml | 1 -
5 files changed, 1 insertion(+), 158 deletions(-)
diff --git a/docs/HTTP11_SOAP_HTTP_CLIENT_C.md b/docs/HTTP11_SOAP_HTTP_CLIENT_C.md
index 957374667..13fed375b 100644
--- a/docs/HTTP11_SOAP_HTTP_CLIENT_C.md
+++ b/docs/HTTP11_SOAP_HTTP_CLIENT_C.md
@@ -72,28 +72,6 @@ int AXIS2_CALL axis2_ssl_stream_read(axutil_stream_t *stream,
- Hostname verification (`client->validate_ssl_hostname`)
- Proxy CONNECT tunneling for HTTPS through HTTP proxy
-### Alternative: libcurl Transport (AXIS2_LIBCURL_ENABLED)
-
-When compiled with `--with-libcurl`, an alternative HTTP client using libcurl is available:
-
-```c
-/* libcurl_stream.c - libcurl-based stream */
-typedef struct libcurl_stream_impl
-{
- axutil_stream_t stream;
- axutil_stream_type_t stream_type;
- axis2_char_t *buffer; /* Response buffer from curl */
- int size;
- int read_len;
-} libcurl_stream_impl_t;
-```
-
-**libcurl advantages:**
-- Built-in HTTP/1.1 and HTTP/2 support
-- Automatic redirect handling
-- Connection pooling and keep-alive
-- Platform SSL/TLS (not just OpenSSL)
-
### Server-Side Stream Adapters
Different server environments require custom stream adapters:
@@ -149,7 +127,6 @@ The prepend stream demonstrates how streams can be composed:
The prepend stream can wrap either:
- A plain socket stream (HTTP)
- An SSL stream (HTTPS)
-- Potentially a libcurl stream
This composition is transparent to the caller - they just see a single `axutil_stream_t*`.
diff --git a/docs/guide/known-limitations.md b/docs/guide/known-limitations.md
deleted file mode 100644
index 381e31c52..000000000
--- a/docs/guide/known-limitations.md
+++ /dev/null
@@ -1,128 +0,0 @@
-# HTTP Connection Map Memory Leak - Known Limitation
-
-## Overview
-The Apache Axis2/C HTTP transport layer has a minor 15-byte memory leak in unit test scenarios related to connection map management. This document describes the issue, its impact, and the rationale for accepting it as a known limitation.
-
-## Technical Details
-
-### Location
-- **File**: `src/core/transport/http/sender/http_sender.c`
-- **Function**: `axis2_http_sender_connection_map_add()`
-- **Line**: 3756
-- **Code**: `axutil_hash_set(connection_map, axutil_strdup(env, server), AXIS2_HASH_KEY_STRING, http_client);`
-
-### Root Cause
-1. **Memory Allocation**: Server names are duplicated using `axutil_strdup()` for use as hash table keys
-2. **Storage**: Connection map is stored as a session-scoped property in the configuration context
-3. **Cleanup Issue**: Session property cleanup is not reliably triggered in short-lived unit test scenarios
-4. **Cleanup Function**: While `axis2_http_sender_connection_map_free()` exists and correctly frees hash keys, it's not consistently invoked during test teardown
-
-### Leak Characteristics
-- **Size**: 15 bytes per HTTP connection (length of "localhost:9090" + null terminator)
-- **Frequency**: Once per service client session in unit tests
-- **Scope**: Limited to unit test environments with short-lived clients
-- **Type**: Non-accumulating (fixed per test run, doesn't grow over time)
-
-## Impact Assessment
-
-### Low Risk Factors
-- **Minimal Size**: Only 15 bytes per test execution
-- **Test-Only**: Does not occur in production HTTP server scenarios
-- **Non-Functional**: No impact on HTTP transport functionality
-- **Non-Security**: No security implications
-- **Contained**: Leak is bounded and predictable
-
-### Detection
-- **Tool**: AddressSanitizer during unit test execution
-- **Output**: `Direct leak of 15 byte(s) in 1 object(s) allocated from axutil_strdup`
-- **Test**: `test/core/clientapi/test_clientapi`
-
-## Architectural Context
-
-### Why This Occurs
-The HTTP connection map is designed for **keep-alive connection management** in long-running server scenarios. The session-scoped property cleanup mechanism works correctly for:
-- Long-lived HTTP server processes
-- Multi-request client sessions
-- Normal application lifecycle management
-
-However, unit tests create a different execution pattern:
-- Very short-lived service clients
-- Immediate teardown after single request
-- Configuration context destroyed before session cleanup completes
-
-### Fix Complexity
-Resolving this leak requires significant architectural changes:
-
-1. **Conditional Compilation Issues**: Connection map functions are wrapped in `#ifndef AXIS2_LIBCURL_ENABLED` blocks that conflict with public API availability
-
-2. **Property Lifecycle Management**: Session-scoped property cleanup timing varies across different execution contexts
-
-3. **API Compatibility**: Making internal cleanup functions public could break existing LIBCURL integration
-
-4. **Testing Infrastructure**: Fundamental changes to how unit tests manage HTTP transport lifecycle
-
-## Attempted Solutions
-
-### 1. Enhanced Cleanup Function
-- **Approach**: Improved `axis2_http_sender_connection_map_free()` with defensive programming
-- **Result**: Function works correctly but isn't consistently invoked
-- **Status**: Function already handles key cleanup properly
-
-### 2. Explicit Service Client Cleanup
-- **Approach**: Added explicit connection map cleanup in `axis2_svc_client_free()`
-- **Result**: Compilation errors due to function visibility
-- **Status**: Abandoned due to architectural conflicts
-
-### 3. Function Visibility Changes
-- **Approach**: Made cleanup function public and added to header file
-- **Result**: Conditional compilation conflicts with public API
-- **Status**: Created more problems than it solved
-
-## Decision Rationale
-
-### Accept as Known Limitation
-Given the **risk/benefit analysis**:
-
-**Low Impact**:
-- 15 bytes per unit test run
-- No production implications
-- No functionality impact
-- Non-accumulating memory usage
-
-**High Complexity**:
-- Requires architectural changes to conditional compilation
-- Risk of breaking LIBCURL integration
-- Potential API compatibility issues
-- Extensive testing required across build configurations
-
-**Conclusion**: The cost of fixing this minor test-only leak outweighs the negligible benefits.
-
-## Monitoring and Management
-
-### Test Output Management
-To reduce the perceived severity of this known limitation:
-
-1. **Test Documentation**: Clear indication that this is a known, acceptable limitation
-2. **Filtered Reporting**: Option to suppress this specific leak in test summaries
-3. **Context**: Ensure test output explains this is test-environment specific
-
-### Long-term Considerations
-- **Architecture Review**: Future HTTP transport refactoring could address this naturally
-- **Test Framework**: Evolution of unit test lifecycle management might resolve the cleanup timing
-- **Build System**: Enhanced conditional compilation management could enable safer fixes
-
-## Conclusion
-
-The 15-byte HTTP connection map memory leak represents a **minor architectural limitation** in session property cleanup for short-lived HTTP connections in unit test scenarios. The leak is:
-
-- **Contained** and **predictable**
-- **Non-functional** and **non-security** related
-- **Test-environment specific**
-- **Architecturally complex** to resolve safely
-
-This limitation is **documented and accepted** as part of the current Axis2/C HTTP transport implementation, with the understanding that future architectural improvements may naturally resolve it.
-
----
-*Document Version: 1.0*
-*Last Updated: November 2024*
-*Status: Known Limitation - Accepted*
\ No newline at end of file
diff --git a/docs/userguide/deploy-localhost.sh b/docs/userguide/deploy-localhost.sh
index 01ad96d6a..00f2e2676 100755
--- a/docs/userguide/deploy-localhost.sh
+++ b/docs/userguide/deploy-localhost.sh
@@ -32,7 +32,7 @@ echo "── Step 1: Installing build dependencies ──"
apt-get update -qq
apt-get install -y -qq \
build-essential autotools-dev autoconf automake libtool pkg-config \
- apache2-dev libssl-dev libcurl4-openssl-dev libjson-c-dev libjson-c5 \
+ apache2-dev libssl-dev libjson-c-dev libjson-c5 \
libxml2-dev uuid-dev zlib1g-dev libnghttp2-dev openssl
# ─────────────────────────────────────────────────────────────────────────────
diff --git a/docs/userguide/json-httpd-h2-userguide.md b/docs/userguide/json-httpd-h2-userguide.md
index c3d875300..9243c1eb5 100644
--- a/docs/userguide/json-httpd-h2-userguide.md
+++ b/docs/userguide/json-httpd-h2-userguide.md
@@ -238,7 +238,6 @@ sudo apt-get install -y \
apache2-dev \
libapache2-mod-h2 \
libssl-dev \
- libcurl4-openssl-dev \
openssl
# Install JSON-C library
@@ -249,7 +248,6 @@ sudo apt-get install -y \
# Install additional dependencies for Axis2/C
sudo apt-get install -y \
libxml2-dev \
- libcurl4-openssl-dev \
uuid-dev \
zlib1g-dev
```
@@ -286,7 +284,6 @@ sudo dnf install -y \
# Install additional dependencies for Axis2/C
sudo dnf install -y \
libxml2-devel \
- libcurl-devel \
libuuid-devel \
zlib-devel
```
@@ -1096,7 +1093,6 @@ echo "🧪 Use curl for comprehensive HTTP/2 JSON testing including XSS protecti
--prefix=/usr/local/axis2c \
--enable-json \
--enable-ssl \
- --enable-libcurl \
--with-apache2=/usr/include/apache2 \
--with-apr=/usr/include/apr-1.0 \
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig \
@@ -1115,7 +1111,6 @@ echo "🧪 Use curl for comprehensive HTTP/2 JSON testing including XSS protecti
--prefix=/usr/local/axis2c \
--enable-json \
--enable-ssl \
- --enable-libcurl \
--with-apache2=/usr/include/httpd \
--with-apr=/usr/include/apr-1 \
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig \
diff --git a/mkdocs.yml b/mkdocs.yml
index 1208ef08e..0cfaa9ce1 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -88,7 +88,6 @@ nav:
- Coding Conventions: guide/coding-conventions.md
- Code Generation: guide/codegen.md
- Linux Packaging: guide/packaging.md
- - Known Limitations: guide/known-limitations.md
- Build System: BUILD_SYSTEM_HTTP2_CHANGES.md
- Conditional Compilation: HTTP2_CONDITIONAL_COMPILATION.md
- Library Loading: HTTP2_LIBRARY_LOADING.md