Skip to content

fix(ApacheConnector): build as C++20 with clang; compare the scheme by content in secure() #5501 - #5502

Merged
matejk merged 2 commits into
mainfrom
5501-apacheconnector-cxx20
Sep 24, 2026
Merged

matejk merged 2 commits into
mainfrom
5501-apacheconnector-cxx20

Conversation

@matejk

@matejk matejk commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #5501. Two fixes in ApacheConnector/src/ApacheConnector.cpp, one commit each.

  • C++20 build with clang. The definition module AP_MODULE_DECLARE_DATA poco_module = ... starts a line with module followed by a name, which C++20 treats as a module directive; clang 21 rejects it. The definition now starts with extern "C", like the forward declaration near the top of the file and the other entry points. The linkage does not change (the forward declaration already gave the variable C linkage), and mod_poco.so still exports poco_module as a C data symbol.
    AP_DECLARE_MODULE(poco) from http_config.h would also avoid the directive, but it adds APLOG_USE_MODULE, which changes the module index that log calls carry, so it is not used here.
  • ApacheRequestRec::secure(). It compared ap_http_scheme() (a const char*) with "https" by address, so it returned false for HTTPS requests. It now compares the text and handles a null scheme. clang flagged this with -Wstring-compare in the same build.

Verification

Ubuntu 26.04, clang 21.1.8, apache2-dev 2.4.66, -DPOCO_MINIMAL_BUILD=ON -DENABLE_APACHECONNECTOR=ON:

CI builds ApacheConnector only in the GCC sanitizer jobs, which accept the old line, so it does not cover the clang C++20 case.

…ule keyword #5501

In C++20 a line that begins with module and a name is a module directive, which clang rejects. The declaration above already gives it C linkage.
#5501

The scheme was compared with a string literal by address, so secure() returned false for HTTPS requests.
@matejk
matejk force-pushed the 5501-apacheconnector-cxx20 branch from c9fcfc0 to c8c5b43 Compare September 24, 2026 11:07
@matejk matejk added this to the Release 2.0 milestone Sep 24, 2026
@matejk matejk added the bug label Sep 24, 2026
@matejk
matejk merged commit 54169af into main Sep 24, 2026
58 checks passed
@matejk
matejk deleted the 5501-apacheconnector-cxx20 branch September 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ApacheConnector: mod_poco does not compile as C++20 with clang; secure() compares the scheme by address

1 participant