Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mux url should look like this: http://localhost:17999/5:/play/stream/…
…mux/9d06e2e9989c2706a198579beab659bb?pids=0,17,18,1560,1520,1522,1530,1532,5005,6005,500,92, where 5 = sid and the following path ist the request to the mux of interest with all necessary pids
  • Loading branch information
root committed Oct 11, 2015
1 parent 159c0a3 commit fca2c40
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions module-emulator-stream.c
Expand Up @@ -550,18 +550,16 @@ static int32_t connect_to_stream(char *http_buf, int32_t http_buf_len, char *str
if(emu_stream_source_auth)
{
snprintf(http_buf, http_buf_len, "GET %s HTTP/1.1\nHost: %s:%u\n"
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\n"
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n"
"Accept-Language: en-US\n"
"User-Agent: Wget/1.16 (linux-gnu)\n"
"Accept: */*\n"
"Authorization: Basic %s\n"
"Connection: keep-alive\n\n", stream_path, emu_stream_source_host, emu_stream_source_port, emu_stream_source_auth);
}
else
{
snprintf(http_buf, http_buf_len, "GET %s HTTP/1.1\nHost: %s:%u\n"
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\n"
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n"
"Accept-Language: en-US\n"
"User-Agent: Wget/1.16 (linux-gnu)\n"
"Accept: */*\n"
"Connection: keep-alive\n\n", stream_path, emu_stream_source_host, emu_stream_source_port);
}

Expand Down Expand Up @@ -670,16 +668,9 @@ static void *stream_client_handler(void *arg)
return NULL;
}

cs_strncpy(stream_path_copy, stream_path, sizeof(stream_path));

token = strtok_r(stream_path_copy, ":", &saveptr);
cs_strncpy(stream_path_copy, stream_path+1, sizeof(stream_path));

for(i=0; token != NULL && i<3; i++)
{
token = strtok_r(NULL, ":", &saveptr);
if(token == NULL)
{ break; }
}
token = strtok_r(stream_path_copy, ":", &saveptr);
if(token != NULL)
{
if(sscanf(token, "%x", &srvidtmp) < 1)
Expand All @@ -689,9 +680,19 @@ static void *stream_client_handler(void *arg)
else
{
data->srvid = srvidtmp & 0xFFFF;
cs_log("[Emu] stream requested SID: %s", token);
}
}


token = strtok_r(NULL, ":", &saveptr);
if(token != NULL)
{
if(sscanf(token, "%s", stream_path) < 1)
{
token = NULL;
}
}

if(token == NULL)
{
NULLFREE(http_buf);
Expand Down

0 comments on commit fca2c40

Please sign in to comment.