online-caro.cpp
/*
* Process the request from the client.
* @param     request   [IN] The client's request.
* @param     response    [OUT] The response from this server.
*/
Process the request from the client.
Process the request from the client .
bool processRequest(char* request, char* response, char* state) {
	char code = getOperationCode(request);
	char* data = (char*)malloc(sizeof(char));
	getData(request, data);
	switch (code) {
	case USERNAME_OPERATION:
		processUsername(data, response, state);
		return true;
	case PASSWORD_OPERATION:
		processPassword(data, response, state);
		return true;
	case LOGOUT_OPERATION:
		processLogout(response, state);
		return true;
	default:
		printf("[WARNING]: Client out\n");
		processLogout(response, state);
		return false;
	}
}
bool processRequest ( char * request , char * response , char * state ) { char code = getOperationCode ( request ) ; char * data = ( char * ) malloc ( sizeof ( char ) ) ; getData ( request , data ) ; switch ( code ) { case USERNAME_OPERATION : processUsername ( data , response , state ) ; return true ; case PASSWORD_OPERATION : processPassword ( data , response , state ) ; return true ; case LOGOUT_OPERATION : processLogout ( response , state ) ; return true ; default : printf ( " \n " ) ; processLogout ( response , state ) ; return false ; } }
Process the request from the client.
Process the request from the client .