add option to read (online) xmltv epg

Origin commit data
------------------
Branch: ni/coolstream
Commit: 8ad9f2e35c
Author: TangoCash <eric@loxat.de>
Date: 2018-09-01 (Sat, 01 Sep 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2018-09-01 14:34:25 +02:00
committed by vanhofen
parent 581c171019
commit 26d32001f6
6 changed files with 193 additions and 2 deletions

View File

@@ -1213,7 +1213,7 @@ static void commandFreeMemory(int connfd, char * /*data*/, const unsigned /*data
static void commandReadSIfromXML(int connfd, char *data, const unsigned dataLength)
{
pthread_t thrInsert;
pthread_t thrInsertXML;
sendEmptyResponse(connfd, NULL, 0);
@@ -1230,7 +1230,33 @@ static void commandReadSIfromXML(int connfd, char *data, const unsigned dataLeng
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (pthread_create (&thrInsert, &attr, insertEventsfromFile, (void *)epg_dir_tmp.c_str() ))
if (pthread_create (&thrInsertXML, &attr, insertEventsfromFile, (void *)epg_dir_tmp.c_str() ))
{
perror("sectionsd: pthread_create()");
}
pthread_attr_destroy(&attr);
}
static void commandReadSIfromIPTVXML(int connfd, char *data, const unsigned dataLength)
{
pthread_t thrInsertIPTV;
sendEmptyResponse(connfd, NULL, 0);
if (dataLength > 100)
return ;
static std::string url_tmp = "";
writeLockMessaging();
data[dataLength] = '\0';
url_tmp = (std::string)data;
unlockMessaging();
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (pthread_create (&thrInsertIPTV, &attr, insertEventsfromHttp, (void *)url_tmp.c_str() ))
{
perror("sectionsd: pthread_create()");
}
@@ -1274,6 +1300,7 @@ static s_cmd_table connectionCommands[sectionsd::numberOfCommands] = {
{ commandReadSIfromXML, "commandReadSIfromXML" },
{ commandWriteSI2XML, "commandWriteSI2XML" },
{ commandSetConfig, "commandSetConfig" },
{ commandReadSIfromIPTVXML, "commandReadSIfromIPTVXML" },
};
bool sectionsd_parse_command(CBasicMessage::Header &rmsg, int connfd)