xmidt-org / curlws

curlws is a websocket implementation that leverages libcurl.
6 stars 1 forks source link

Refactor the close code per websocket spec #50

Closed schmidtw closed 3 years ago

schmidtw commented 3 years ago

This change enables the code to ensure a close frame is sent and received, then after both, the connection is closed. Due to the likely ongoing debugging needed a verbose_close() call was made to simplfy the output of the connection state.

Overall this works with a real test server and also works when the cord is pulled from the connection (a 56 after a timeout occurs).

codecov[bot] commented 3 years ago

Codecov Report

Merging #50 (161786c) into main (c893309) will decrease coverage by 0.11%. The diff coverage is 81.63%.

:exclamation: Current head 161786c differs from pull request most recent head 7b72e10. Consider uploading reports for the commit 7b72e10 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
- Coverage   86.40%   86.28%   -0.12%     
==========================================
  Files          34       34              
  Lines        3383     3405      +22     
==========================================
+ Hits         2923     2938      +15     
- Misses        460      467       +7     
Impacted Files Coverage Δ
tests/test_autobahn_27.c 92.64% <0.00%> (-1.39%) :arrow_down:
tests/test_receive.c 72.77% <0.00%> (-0.39%) :arrow_down:
src/verbose.c 86.66% <80.00%> (-13.34%) :arrow_down:
src/receive.c 97.59% <83.33%> (-1.42%) :arrow_down:
src/curlws.c 96.80% <100.00%> (+0.02%) :arrow_up:
src/frame_senders.c 100.00% <100.00%> (ø)
src/send.c 84.93% <100.00%> (+0.42%) :arrow_up:
tests/test_data_block_sender.c 97.61% <100.00%> (ø)
tests/test_frame_senders.c 99.01% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c893309...7b72e10. Read the comment docs.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.3% 88.3% Coverage
0.0% 0.0% Duplication