diff options
Diffstat (limited to 'frontend_svr.c')
-rw-r--r-- | frontend_svr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/frontend_svr.c b/frontend_svr.c index 4403a9c4..c58888f4 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.60 2008-11-14 22:01:57 phintuka Exp $ + * $Id: frontend_svr.c,v 1.61 2008-11-16 15:02:45 rofafor Exp $ * */ @@ -1688,16 +1688,22 @@ void cXinelibServer::Handle_ClientConnected(int fd) bool accepted = SVDRPhosts.Acceptable(sin.sin_addr.s_addr); if(!accepted) { + const char *msg = "Access denied.\r\n"; + ssize_t len = strlen(msg); LOGMSG("Address not allowed to connect (svdrphosts.conf)."); - (void)write(fd, "Access denied.\r\n", 16); + if(write(fd, msg, len) != len) + LOGERR("Write failed."); CLOSESOCKET(fd); return; } if(cli>=MAXCLIENTS) { + const char *msg = "Server busy.\r\n"; + ssize_t len = strlen(msg); // too many clients LOGMSG("Too many clients, connection refused"); - (void)write(fd, "Server busy.\r\n", 16); + if(write(fd, msg, len) != len) + LOGERR("Write failed."); CLOSESOCKET(fd); return; } |