network: cleanup and improve network handling

- Merge encoded / plain messge handling to ensure fixes land in both
- Fix some potential resource leaks spotted by Coverity

[cleanup commit message]
[fix merge conflicts]
Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Ian Clowes 2022-01-31 10:53:59 +00:00 committed by Nick Hainke
parent 0eca0fae0b
commit 0a962bea1f
5 changed files with 117 additions and 95 deletions

View file

@ -15,16 +15,10 @@ int init_socket_runopts(const char *_ip, int _port, int _multicast_socket);
/**
* Send message via network.
* @param msg
* @param is_enc
* @return
*/
int send_string(char *msg);
/**
* Send encrypted message via network.
* @param msg
* @return
*/
int send_string_enc(char *msg);
int send_string(char *msg, bool is_enc);
/**
* Close socket.