Skip to content
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

streams: add explicit stop functions #1987

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

streams: add explicit stop functions #1987

wants to merge 1 commit into from

Conversation

gdamore
Copy link
Contributor

@gdamore gdamore commented Dec 13, 2024

This allows us to explicitly stop streams, dialers, and listeners, before we start tearing down things. This hopefully will be useful in resolving use-after-free bugs in http, tls, and websockets.

The new functions are not yet documented, but they are nng_stream_stop, nng_stream_dialer_stop, and nng_stream_listener_stop. They should be called after close, and before free. The close functions now close without blocking, but the stop function is allowed to block.

fixes #

Note that the above format should be used in your git commit comments.
You agree that by submitting a PR, you have read and agreed to our
contributing guidelines.

This allows us to explicitly stop streams, dialers, and listeners,
before we start tearing down things. This hopefully will be useful
in resolving use-after-free bugs in http, tls, and websockets.

The new functions are not yet documented, but they are
nng_stream_stop, nng_stream_dialer_stop, and nng_stream_listener_stop.
They should be called after close, and before free.  The close
functions now close without blocking, but the stop function is
allowed to block.
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 92.61084% with 15 lines in your changes missing coverage. Please review.

Project coverage is 81.73%. Comparing base (90308d8) to head (81f5d3c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/platform/posix/posix_tcpdial.c 50.00% 4 Missing ⚠️
src/core/sockfd.c 25.00% 3 Missing ⚠️
src/platform/posix/posix_ipcdial.c 70.00% 3 Missing ⚠️
src/core/tcp.c 90.90% 2 Missing ⚠️
src/platform/posix/posix_ipclisten.c 93.33% 1 Missing ⚠️
src/platform/posix/posix_tcplisten.c 85.71% 1 Missing ⚠️
src/sp/transport/ws/websocket.c 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1987      +/-   ##
==========================================
- Coverage   81.87%   81.73%   -0.15%     
==========================================
  Files          95       95              
  Lines       24094    24232     +138     
  Branches     3201     3208       +7     
==========================================
+ Hits        19728    19805      +77     
- Misses       4293     4355      +62     
+ Partials       73       72       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant