Fix imported target dependencies for OpenSSL#1
Open
trondn wants to merge 6 commits into
Open
Conversation
CMake V3.4 allows to search for the components SSL and Crypto and defines targets for them. The targets should be used instead of the old variables as they populate the correct include path and libraries. The targets should also be used in our interface library definition so that it'll continue to work if OpenSSL was moved after the cmake files was created.
daverigby
suggested changes
Sep 15, 2022
daverigby
left a comment
There was a problem hiding this comment.
Suggest we also propose this upstream to the main libevent repo.
| find_package(OpenSSL REQUIRED COMPONENTS Crypto SSL) | ||
| list(APPEND LIB_APPS OpenSSL::SSL OpenSSL::Crypto) | ||
| else() | ||
| find_package(OpenSSL REQUIRED) |
There was a problem hiding this comment.
Arguably better to do this based on behaviour - i.e. call find_package(OpenSSL ...), then if the modern-style targets exist use them otherwise use OPENSSL_LIBRARIES.
Author
|
There is some problems with the change when trying from a clean repo... more testing underway |
When activating an event_callback (like those used for deferred bufferevent callbacks), we now set base->event_continue if the new callback has a higher priority than the one currently being processed. Previously, this logic was only present in event_active_nolock_. Moving it to event_callback_activate_nolock_ ensures that all callback activations (including those from bufferevent_trigger) properly interrupt lower-priority queues, preventing starvation during high I/O volume.
1767058 to
12525b7
Compare
Add the /.idea/ directory to .gitignore to prevent local IDE-specific project configurations, caches, and developer profiles from being accidentally tracked in the repository.
Under OpenSSL 3.0+, unexpected socket closures before a clean SSL/TLS shutdown alert is exchanged are classified as protocol errors rather than clean EOFs. This behavior change causes various regression tests to fail. To resolve these compatibility issues: 1. bufferevent_openssl.c: Identify the SSL_R_UNEXPECTED_EOF_WHILE_READING protocol error and treat it as a dirty shutdown (clean TCP closure) to ensure backward compatibility. 2. test/regress_http.c (https_bev): Enable 'allow_dirty_shutdown = 1' on server bufferevents inside the mock HTTPS server to cleanly handle abrupt client socket closures. 3. test/regress_http.c (http_incomplete_errorcb): Recognize SSL protocol errors arising from raw socket shutdowns on OpenSSL 3.0 as successful terminations during the incomplete HTTP request test.
Implement kernel-measured socket receive timestamps with nanosecond precision on supported platforms via recvmsg() syscall. Timestamps are stored per-chain in the evbuffer. Infrastructure changes: - evbuffer-internal.h: Add timestamp storage to evbuffer_chain structure with validity flag - evbuffer_read_with_timestamp(): New internal function for reading data with kernel timestamp parsing and validation, including MSG_CTRUNC and cmsg_len checks - bufferevent-internal.h: Add recv_timestamps_enabled flag to bufferevent_private structure - bufferevent_sock.c: Integrate recvmsg() wrapper for socket reads when BEV_OPT_RECV_TIMESTAMPS is set - bufferevent_openssl.c: Pass timestamps from underlying bufferevent through SSL decryption layer in filtered mode via evbuffer_read_with_timestamp() - Build system: Platform detection for SO_TIMESTAMP and SO_TIMESTAMPNS socket options Public API additions: - BEV_OPT_RECV_TIMESTAMPS flag for opt-in timestamp capture on socket bufferevents - evbuffer_get_timestamp() function to retrieve stored timestamp with nanosecond precision - Documentation of timestamp semantics and availability Platform support: - Linux 2.6.22+: nanosecond (SO_TIMESTAMPNS) and microsecond (SO_TIMESTAMP) precision - macOS 10.12+: microsecond (SO_TIMESTAMP) precision Testing: All existing tests pass. Added regress tests for socket and SSL bufferevent timestamp functionality. Note: This commit implements the timestamp plumbing and storage infrastructure. Public API functions to access timestamps are separate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0cff36d to
4672c46
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CMake V3.4 allows to search for the components SSL and Crypto and defines targets for them.
The targets should be used instead of the old variables as they populate the correct include path and libraries.
The targets should also be used in our interface library definition so that it'll continue to work if OpenSSL was moved after the cmake files was created.