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

Implement destructor #4

Merged
merged 2 commits into from
Apr 7, 2024
Merged

Implement destructor #4

merged 2 commits into from
Apr 7, 2024

Conversation

blechschmidt
Copy link
Member

Hi @ssrlive,

I have removed the explicit tproxy_remove function and replaced it with a Drop implementation, so that the removal also takes place in case there is an error (as suggested by @one-d-wide in tun2proxy/tun2proxy#104).

This should also eliminate the need for the state file in most cases. I was hesitant to remove the code for the state file completely though, as it may still be needed in case tun2proxy is killed through external means, e.g. SIGKILL on Linux.

As of now, tproxy_remove never operated on the file anyway as it was always called on the TProxyState.

What do you think?

@ssrlive
Copy link
Member

ssrlive commented Apr 7, 2024

Thanks for your work. I think it is appropriate to keep the state file.

@ssrlive ssrlive force-pushed the destructor branch 2 times, most recently from b3a542b to 303f6e7 Compare April 7, 2024 04:56
@ssrlive ssrlive merged commit 89a69c7 into master Apr 7, 2024
6 checks passed
@ssrlive ssrlive deleted the destructor branch April 7, 2024 05:05
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.

None yet

2 participants