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

Sockets must only be closed a single time #68

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Conversation

swhitty
Copy link
Owner

@swhitty swhitty commented Sep 18, 2023

Sockets cannot be closed multiple times. The listening socket of HTTPServer is closed in both stop() async and if an error is thrown in start() async throws — the socket is now only closed once and then the reference is removed preventing the another close attempt.

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (743be61) 98.56% compared to head (c3ac2aa) 98.56%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #68   +/-   ##
=======================================
  Coverage   98.56%   98.56%           
=======================================
  Files          48       48           
  Lines        2717     2724    +7     
=======================================
+ Hits         2678     2685    +7     
  Misses         39       39           
Files Changed Coverage Δ
FlyingFox/Sources/HTTPServer.swift 98.63% <100.00%> (+0.04%) ⬆️

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

@swhitty swhitty linked an issue Sep 18, 2023 that may be closed by this pull request
@swhitty swhitty merged commit 4f4db93 into main Sep 18, 2023
19 checks passed
@swhitty swhitty deleted the fix-double-close branch September 18, 2023 22:45
@swhitty swhitty mentioned this pull request Sep 18, 2023
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.

Crash on Socket.close()
1 participant