Skip to content
Snippets Groups Projects

streamrelay: Fix module start

Merged WXbet requested to merge fix-11863 into master
Compare and Show latest version
1 file
+ 1
17
Compare changes
  • Side-by-side
  • Inline
+ 1
17
@@ -793,7 +793,6 @@ static void stream_client_disconnect(stream_client_conn_data *conndata)
if(streamrelay_client[conndata->connid] && !cfg.stream_reuse_client && !streamrelay_client[conndata->connid]->kill_started)
{
free_client(streamrelay_client[conndata->connid]);
streamrelay_client[conndata->connid] = NULL;
}
cs_log("Stream client %i disconnected. ip=%s port=%d", conndata->connid, cs_inet_ntoa(connip[conndata->connid]), connport[conndata->connid]);
@@ -937,7 +936,7 @@ static void *stream_client_handler(void *arg)
//use host from stream client http request as stream source host, if 'Host: host:port' header was send
else if(strchr(http_host,':'))
{
char *hostline = cs_strdup((const char *)&http_buf);
char *hostline = cs_strdup((const char *)&http_host);
cs_strncpy(conndata->connhost, strsep(&hostline, ":"), sizeof(conndata->connhost));
}
//use the IP address of the stream client itself as host for the stream source
@@ -1388,20 +1387,6 @@ void stop_stream_server(void)
NULLFREE(stream_source_auth);
}
static void streamrelay_idle(struct s_client *UNUSED(cl))
{
int32_t i;
if (cfg.stream_reuse_client)
{
for (i = 0; i < STREAM_SERVER_MAX_CONNECTIONS; i++)
{
if (streamrelay_client[i]->kill)
{ streamrelay_client[i] = NULL; }
}
}
}
/*
* protocol structure
*/
@@ -1410,6 +1395,5 @@ void module_streamrelay(struct s_module *ph)
ph->desc = "streamrelay";
ph->type = MOD_CONN_SERIAL;
ph->s_handler = streamrelay_handler;
ph->s_idle = streamrelay_idle;
}
#endif // MODULE_STREAMRELAY
Loading