147 |
if (FD_ISSET((*iter).hSession, &selectSet)) { //Was it this socket? |
if (FD_ISSET((*iter).hSession, &selectSet)) { //Was it this socket? |
148 |
if (GetLSCPCommand(iter)) { //Have we read the entire command? |
if (GetLSCPCommand(iter)) { //Have we read the entire command? |
149 |
dmsg(3,("LSCPServer: Got command on socket %d, calling parser.\n", currentSocket)); |
dmsg(3,("LSCPServer: Got command on socket %d, calling parser.\n", currentSocket)); |
150 |
yylex_init(&((*iter).pScanner)); //FIXME: should me moved out of this loop and initialized only when a new session is created |
int dummy; // just a temporary hack to fulfill the restart() function prototype |
151 |
|
restart(NULL, dummy); // restart the 'scanner' |
152 |
currentSocket = (*iter).hSession; //a hack |
currentSocket = (*iter).hSession; //a hack |
153 |
if ((*iter).bVerbose) { // if echo mode enabled |
if ((*iter).bVerbose) { // if echo mode enabled |
154 |
AnswerClient(bufferedCommands[currentSocket]); |
AnswerClient(bufferedCommands[currentSocket]); |
174 |
} |
} |
175 |
NotifyBufferMutex.Unlock(); |
NotifyBufferMutex.Unlock(); |
176 |
} |
} |
|
//It will never get here anyway |
|
|
//yylex_destroy(yyparse_param.pScanner); |
|
177 |
} |
} |
178 |
|
|
179 |
void LSCPServer::CloseConnection( std::vector<yyparse_param_t>::iterator iter ) { |
void LSCPServer::CloseConnection( std::vector<yyparse_param_t>::iterator iter ) { |
192 |
bufferedNotifies.erase(socket); |
bufferedNotifies.erase(socket); |
193 |
close(socket); |
close(socket); |
194 |
NotifyMutex.Unlock(); |
NotifyMutex.Unlock(); |
|
//yylex_destroy((*iter).pScanner); |
|
195 |
} |
} |
196 |
|
|
197 |
void LSCPServer::SendLSCPNotify( LSCPEvent event ) { |
void LSCPServer::SendLSCPNotify( LSCPEvent event ) { |