summaryrefslogtreecommitdiff
path: root/frontend_svr.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontend_svr.c')
-rw-r--r--frontend_svr.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/frontend_svr.c b/frontend_svr.c
index 0a8e05f0..ab7433bf 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.11 2006-08-07 17:08:33 phintuka Exp $
+ * $Id: frontend_svr.c,v 1.12 2006-08-16 21:46:34 phintuka Exp $
*
*/
@@ -446,17 +446,21 @@ int cXinelibServer::Xine_Control(const char *cmd)
{
TRACEF("cXinelibServer::Xine_Control");
- char buf[128];
- sprintf(buf, "%s\r\n", cmd);
- int len = strlen(buf);
- LOCK_THREAD;
+ if(cmd && *cmd) {
+ char buf[2048];
+ int len;
+ sprintf(buf, "%s\r\n", cmd);
+ len = strlen(buf);
- for(int i=0; i<MAXCLIENTS; i++)
- if(fd_control[i]>=0 && (fd_data[i]>=0 || m_bMulticast[i]) && m_bConfigOk[i])
- if(len != timed_write(fd_control[i], buf, len, 100)) {
- LOGMSG("Control send failed (%s), dropping client", cmd);
- CloseConnection(i);
- }
+ LOCK_THREAD;
+
+ for(int i=0; i<MAXCLIENTS; i++)
+ if(fd_control[i]>=0 && (fd_data[i]>=0 || m_bMulticast[i]) && m_bConfigOk[i])
+ if(len != timed_write(fd_control[i], buf, len, 100)) {
+ LOGMSG("Control send failed (%s), dropping client", cmd);
+ CloseConnection(i);
+ }
+ }
return 1;
}