diff options
Diffstat (limited to 'frontend_svr.c')
-rw-r--r-- | frontend_svr.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/frontend_svr.c b/frontend_svr.c index 93ccdeab..43c74744 100644 --- a/frontend_svr.c +++ b/frontend_svr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.c,v 1.56.2.5 2009-06-04 13:16:37 phintuka Exp $ + * $Id: frontend_svr.c,v 1.56.2.2 2008-09-26 19:37:37 phintuka Exp $ * */ @@ -715,7 +715,7 @@ bool cXinelibServer::HasClients(void) return false; } -int cXinelibServer::PlayFileCtrl(const char *Cmd, int TimeoutMs) +int cXinelibServer::PlayFileCtrl(const char *Cmd) { /* Check if there are any clients */ if(!HasClients()) { @@ -750,7 +750,6 @@ int cXinelibServer::PlayFileCtrl(const char *Cmd, int TimeoutMs) #endif int timeout = bPlayfile ? PLAYFILE_TIMEOUT : PLAYFILE_CTRL_TIMEOUT; - if(TimeoutMs > 0) timeout = TimeoutMs; future.Wait(timeout); @@ -1332,12 +1331,11 @@ void cXinelibServer::Handle_Control_HTTP(int cli, const char *arg) else if(!strncmp(m_State[cli]->Uri(), "/PLAYFILE", 9)) { if( *m_FileName && m_bPlayingFile) { - cString file = m_FileName; - const char *pos = strstr(m_FileName, "#subtitle:"); - if(pos) - file.Truncate(pos - m_FileName); - bool Allow = ( !strcmp_escaped(file, m_State[cli]->Uri() + 9) + char *pos = strstr(m_FileName, "#subtitle:"); + if(pos) *pos = 0; + bool Allow = ( !strcmp_escaped(m_FileName, m_State[cli]->Uri() + 9) || (pos && !strcmp_escaped(pos + 10, m_State[cli]->Uri() + 9))); + if(pos) *pos = '#'; if(Allow) { LOGMSG("HTTP streaming media file"); @@ -1691,8 +1689,7 @@ void cXinelibServer::Handle_ClientConnected(int fd) bool accepted = SVDRPhosts.Acceptable(sin.sin_addr.s_addr); if(!accepted) { LOGMSG("Address not allowed to connect (svdrphosts.conf)."); - if (write(fd, "Access denied.\r\n", 16) != 16) - LOGERR("Write failed"); + write(fd, "Access denied.\r\n", 16); CLOSESOCKET(fd); return; } |