Commit 648947fe authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Cleanup: Provided connection_send_bytes() to avoid direct access to con->send()

parent 3f76299e
...@@ -627,7 +627,7 @@ admin_format_t client_get_admin_format_by_content_negotiation(client_t *client) ...@@ -627,7 +627,7 @@ admin_format_t client_get_admin_format_by_content_negotiation(client_t *client)
/* helper function for sending the data to a client */ /* helper function for sending the data to a client */
int client_send_bytes(client_t *client, const void *buf, unsigned len) int client_send_bytes(client_t *client, const void *buf, unsigned len)
{ {
int ret = client->con->send(client->con, buf, len); int ret = connection_send_bytes(client->con, buf, len);
if (client->con->error) if (client->con->error)
ICECAST_LOG_DEBUG("Client connection died"); ICECAST_LOG_DEBUG("Client connection died");
......
...@@ -297,6 +297,11 @@ void connection_uses_tls(connection_t *con) ...@@ -297,6 +297,11 @@ void connection_uses_tls(connection_t *con)
#endif #endif
} }
ssize_t connection_send_bytes(connection_t *con, const void *buf, size_t len)
{
return con->send(con, buf, len);
}
ssize_t connection_read_bytes(connection_t *con, void *buf, size_t len) ssize_t connection_read_bytes(connection_t *con, void *buf, size_t len)
{ {
ssize_t done = 0; ssize_t done = 0;
......
...@@ -60,6 +60,7 @@ int connection_complete_source(source_t *source, int response); ...@@ -60,6 +60,7 @@ int connection_complete_source(source_t *source, int response);
void connection_queue(connection_t *con); void connection_queue(connection_t *con);
void connection_uses_tls(connection_t *con); void connection_uses_tls(connection_t *con);
ssize_t connection_send_bytes(connection_t *con, const void *buf, size_t len);
ssize_t connection_read_bytes(connection_t *con, void *buf, size_t len); ssize_t connection_read_bytes(connection_t *con, void *buf, size_t len);
int connection_read_put_back(connection_t *con, const void *buf, size_t len); int connection_read_put_back(connection_t *con, const void *buf, size_t len);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment