openelp icon indicating copy to clipboard operation
openelp copied to clipboard

Fix socket handle leak for outgoing TCP connections

Open cottsay opened this issue 10 months ago • 1 comments

If a proxy client sends a TCP_OPEN message while the proxy already has an open connection, the proxy will leak the handle to the original connection to process the new one.

After testing this scenario on the Java implementation, it appears to send a TCP_CLOSE message to the client for the original connection and then immediately open a new connection. It's hard to tell if this is what the EchoLink client wants us to do, but taking the same behavior as the Java proxy is certainly better than leaking the handle like we were doing, so that's what this change does.

cottsay avatar Jan 20 '25 04:01 cottsay

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 51.47%. Comparing base (5e41d0e) to head (f3dbee8).

Files with missing lines Patch % Lines
src/proxy_conn.c 0.00% 20 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   51.67%   51.47%   -0.20%     
==========================================
  Files          22       22              
  Lines        2901     2908       +7     
==========================================
- Hits         1499     1497       -2     
- Misses       1402     1411       +9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 20 '25 04:01 codecov-commenter