libs/StartExe/StartExe.cpp
//--------------------------------------------------------------------------------------------
// Client send editor an operation request
//--------------------------------------------------------------------------------------------
Client send editor an operation request
Client send editor an operation request
int ProcessClientQuery(ClientDescriptor* client) {
char* command;
int readed;
char vals[10][1000];
	command = ReceiveString(client->m_ClientSocket);
    if(command == NULL) {
         _DBG(fprintf(log_fd,"Client disconnected. Removing dead client.\n"));
	     ClientDescriptor::RemoveClient(client);
		 return 1;
	}
	readed = strlen(command);
    _DBG(fprintf(log_fd,"Processing client query.\n"));
	char word[1000];
	word[0]=0;
	int chcount=0;
	int lcount = 0;
	int i;
	for(i=0;i<readed;i++) {
		if(command[i]=='\t') {
			word[chcount] = 0;
			strcpy(vals[lcount++],word);
			chcount = 0;
			continue;
		}
		if(chcount<998) word[chcount++]=command[i];
	}
    if(chcount>=0) {
		word[chcount] = 0;
		strcpy(vals[lcount++],word);
	}
	if(lcount>0) {
		 ProcessOneCommand(client,vals,lcount);
		 return 1;
	}
	return 0;
}
int ProcessClientQuery ( ClientDescriptor * client ) { char * command ; int readed ; char vals [ 10 ] [ 1000 ] ; command = ReceiveString ( client -> m_ClientSocket ) ; if ( command == NULL ) { _DBG ( fprintf ( log_fd , " \n " ) ) ; ClientDescriptor :: RemoveClient ( client ) ; return 1 ; } readed = strlen ( command ) ; _DBG ( fprintf ( log_fd , " \n " ) ) ; char word [ 1000 ] ; word [ 0 ] = 0 ; int chcount = 0 ; int lcount = 0 ; int i ; for ( i = 0 ; i < readed ; i ++ ) { if ( command [ i ] == ' \t ' ) { word [ chcount ] = 0 ; strcpy ( vals [ lcount ++ ] , word ) ; chcount = 0 ; continue ; } if ( chcount < 998 ) word [ chcount ++ ] = command [ i ] ; } if ( chcount >= 0 ) { word [ chcount ] = 0 ; strcpy ( vals [ lcount ++ ] , word ) ; } if ( lcount > 0 ) { ProcessOneCommand ( client , vals , lcount ) ; return 1 ; } return 0 ; }
Client send editor an operation request
Client send editor an operation request
// Redirecting query from the client to the server // Tokenizing string query and placing all tokens into the  // vals matrix