Commit 26db893c authored by sletz's avatar sletz
Browse files

Cleanup

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2281 0c269be4-1314-0410-8aa9-9f06e86f4224
parent dc08aa37
......@@ -135,7 +135,7 @@ void JackSocketServerChannel::ClientKill(int fd)
fRebuild = true;
}
int JackSocketServerChannel::HandleRequest(int fd)
bool JackSocketServerChannel::HandleRequest(int fd)
{
pair<int, JackClientSocket*> elem = fSocketTable[fd];
JackClientSocket* socket = elem.second;
......@@ -145,7 +145,7 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackRequest header;
if (header.Read(socket) < 0) {
jack_error("HandleRequest: cannot read header");
return -1;
return false;
}
// Read data
......@@ -374,7 +374,7 @@ int JackSocketServerChannel::HandleRequest(int fd)
break;
}
return 0;
return true;
}
void JackSocketServerChannel::BuildPoolTable()
......@@ -418,22 +418,17 @@ bool JackSocketServerChannel::Execute()
jack_log("Poll client error err = %s", strerror(errno));
ClientKill(fd);
} else if (fPollTable[i].revents & POLLIN) {
if (HandleRequest(fd) < 0) {
if (!HandleRequest(fd))
jack_error("Could not handle external client request");
//ClientRemove(fd); TO CHECK
}
}
}
// Check the server request socket */
if (fPollTable[0].revents & POLLERR) {
if (fPollTable[0].revents & POLLERR)
jack_error("Error on server request socket err = %s", strerror(errno));
//return false; TO CHECK
}
if (fPollTable[0].revents & POLLIN) {
if (fPollTable[0].revents & POLLIN)
ClientCreate();
}
}
BuildPoolTable();
......
......@@ -45,7 +45,7 @@ class JackSocketServerChannel : public JackServerChannelInterface, public JackRu
bool fRebuild;
std::map<int, std::pair<int, JackClientSocket*> > fSocketTable;
int HandleRequest(int fd);
bool HandleRequest(int fd);
void BuildPoolTable();
void ClientCreate();
......
......@@ -84,15 +84,15 @@ void JackClientPipeThread::Close() // Close the Server/Client connection
bool JackClientPipeThread::Execute()
{
jack_log("JackClientPipeThread::Execute");
return (HandleRequest() == 0);
return(HandleRequest();
}
int JackClientPipeThread::HandleRequest()
bool JackClientPipeThread::HandleRequest()
{
// Read header
JackRequest header;
int res = header.Read(fPipe);
int ret = 0;
bool ret = true;
// Lock the global mutex
if (WaitForSingleObject(fMutex, INFINITE) == WAIT_FAILED)
......@@ -101,7 +101,7 @@ int JackClientPipeThread::HandleRequest()
if (res < 0) {
jack_error("HandleRequest: cannot read header");
ClientKill();
ret = -1;
ret = false;
} else {
// Read data
......@@ -135,7 +135,7 @@ int JackClientPipeThread::HandleRequest()
res.fResult = fServer->GetEngine()->ClientExternalClose(req.fRefNum);
res.Write(fPipe);
ClientRemove();
ret = -1;
ret = false;
break;
}
......
......@@ -53,7 +53,7 @@ class JackClientPipeThread : public JackRunnableInterface
int Open(JackServer* server); // Open the Server/Client connection
void Close(); // Close the Server/Client connection
int HandleRequest();
bool HandleRequest();
// JackRunnableInterface interface
bool Execute();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment