library/src/blockclass/BP-BlockClass.cc
// saves app engine data to the database
saves app engine data to the database
saves app engine data to the database
BP_ERROR_T Block::WebAssessmentSaveAppEngineData()
{
	BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION;
	if(this->webAssessment->appErrorResults)
	{
		size_t index_iterator = 0;
		P_BP_WEB_APPSERVER_TEST_RESULT app_result = this->webAssessment->appErrorResults->first;
		for
		(
				;
				app_result;
				app_result = app_result->next
		)
		{
			for
			(
					index_iterator = 0;
					index_iterator < app_result->phpTestMatchesMade;
					index_iterator++
			)
			{
				this->WebAssessmentAddEngineAnalysisDataEntry
				(
						app_result->request_data.result_id,
						app_result->request_data.request_id,
						app_result->request_data.http_status_code,
						(char *) &app_result->request_data.http_get,
						(char *) &app_result->request_data.http_post,
						(char *) &app_result->request_data.http_cookie,
						(char *) &app_result->request_data.http_header,
						(char *) &app_result->request_data.suspected_get_var,
						(char *) &app_result->request_data.suspected_post_var,
						(char *) &app_result->request_data.suspected_cookie_var,
						(char *) &app_result->request_data.suspected_header_var,
						BP_WEB_ANALYSIS_ENGINES_PHP,
						BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG,
						(char *) this->webAssessment->phpErrCodes[app_result->phpTestMatchIndexes[index_iterator]].phpErrStr,
						(char *) this->webAssessment->phpErrCodes[app_result->phpTestMatchIndexes[index_iterator]].phpErrStr,
						app_result->phpTestMatchIndexes[index_iterator]
				);
			}
			for
			(
					index_iterator = 0;
					index_iterator < app_result->aspTestMatchesMade;
					index_iterator++
			)
			{
				this->WebAssessmentAddEngineAnalysisDataEntry
				(
						app_result->request_data.result_id,
						app_result->request_data.request_id,
						app_result->request_data.http_status_code,
						(char *) &app_result->request_data.http_get,
						(char *) &app_result->request_data.http_post,
						(char *) &app_result->request_data.http_cookie,
						(char *) &app_result->request_data.http_header,
						(char *) &app_result->request_data.suspected_get_var,
						(char *) &app_result->request_data.suspected_post_var,
						(char *) &app_result->request_data.suspected_cookie_var,
						(char *) &app_result->request_data.suspected_header_var,
						BP_WEB_ANALYSIS_ENGINES_ASP,
						BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG,
						(char *) this->webAssessment->aspErrCodes[app_result->aspTestMatchIndexes[index_iterator]].description,
						(char *) this->webAssessment->aspErrCodes[app_result->aspTestMatchIndexes[index_iterator]].description,
						app_result->aspTestMatchIndexes[index_iterator]
				);
			}
			for
			(
					index_iterator = 0;
					index_iterator < app_result->jspTestMatchesMade;
					index_iterator++
			)
			{
				this->WebAssessmentAddEngineAnalysisDataEntry
				(
						app_result->request_data.result_id,
						app_result->request_data.request_id,
						app_result->request_data.http_status_code,
						(char *) &app_result->request_data.http_get,
						(char *) &app_result->request_data.http_post,
						(char *) &app_result->request_data.http_cookie,
						(char *) &app_result->request_data.http_header,
						(char *) &app_result->request_data.suspected_get_var,
						(char *) &app_result->request_data.suspected_post_var,
						(char *) &app_result->request_data.suspected_cookie_var,
						(char *) &app_result->request_data.suspected_header_var,
						BP_WEB_ANALYSIS_ENGINES_JSP,
						BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG,
						(char *) this->webAssessment->jspErrCodes[app_result->jspTestMatchIndexes[index_iterator]].description,
						(char *) this->webAssessment->jspErrCodes[app_result->jspTestMatchIndexes[index_iterator]].description,
						app_result->jspTestMatchIndexes[index_iterator]
				);
			}
			for
			(
					index_iterator = 0;
					index_iterator < app_result->cfmTestMatchesMade;
					index_iterator++
			)
			{
				this->WebAssessmentAddEngineAnalysisDataEntry
				(
						app_result->request_data.result_id,
						app_result->request_data.request_id,
						app_result->request_data.http_status_code,
						(char *) &app_result->request_data.http_get,
						(char *) &app_result->request_data.http_post,
						(char *) &app_result->request_data.http_cookie,
						(char *) &app_result->request_data.http_header,
						(char *) &app_result->request_data.suspected_get_var,
						(char *) &app_result->request_data.suspected_post_var,
						(char *) &app_result->request_data.suspected_cookie_var,
						(char *) &app_result->request_data.suspected_header_var,
						BP_WEB_ANALYSIS_ENGINES_CFM,
						BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG,
						(char *) this->webAssessment->cfmErrCodes[app_result->cfmTestMatchIndexes[index_iterator]].description,
						(char *) this->webAssessment->cfmErrCodes[app_result->cfmTestMatchIndexes[index_iterator]].description,
						app_result->cfmTestMatchIndexes[index_iterator]
				);
			}
			for
			(
					index_iterator = 0;
					index_iterator < app_result->dnetTestMatchesMade;
					index_iterator++
			)
			{
				this->WebAssessmentAddEngineAnalysisDataEntry
				(
						app_result->request_data.result_id,
						app_result->request_data.request_id,
						app_result->request_data.http_status_code,
						(char *) &app_result->request_data.http_get,
						(char *) &app_result->request_data.http_post,
						(char *) &app_result->request_data.http_cookie,
						(char *) &app_result->request_data.http_header,
						(char *) &app_result->request_data.suspected_get_var,
						(char *) &app_result->request_data.suspected_post_var,
						(char *) &app_result->request_data.suspected_cookie_var,
						(char *) &app_result->request_data.suspected_header_var,
						BP_WEB_ANALYSIS_ENGINES_DNET,
						BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG,
						(char *) this->webAssessment->dnetErrCodes[app_result->dnetTestMatchIndexes[index_iterator]].exceptionStr,
						(char *) this->webAssessment->dnetErrCodes[app_result->dnetTestMatchIndexes[index_iterator]].exceptionStr,
						app_result->dnetTestMatchIndexes[index_iterator]
				);
			}
		}
	}
	BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_SUCCESS);
}
BP_ERROR_T Block :: WebAssessmentSaveAppEngineData ( ) { BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION ; if ( this -> webAssessment -> appErrorResults ) { size_t index_iterator = 0 ; P_BP_WEB_APPSERVER_TEST_RESULT app_result = this -> webAssessment -> appErrorResults -> first ; for ( ; app_result ; app_result = app_result -> next ) { for ( index_iterator = 0 ; index_iterator < app_result -> phpTestMatchesMade ; index_iterator ++ ) { this -> WebAssessmentAddEngineAnalysisDataEntry ( app_result -> request_data . result_id , app_result -> request_data . request_id , app_result -> request_data . http_status_code , ( char * ) & app_result -> request_data . http_get , ( char * ) & app_result -> request_data . http_post , ( char * ) & app_result -> request_data . http_cookie , ( char * ) & app_result -> request_data . http_header , ( char * ) & app_result -> request_data . suspected_get_var , ( char * ) & app_result -> request_data . suspected_post_var , ( char * ) & app_result -> request_data . suspected_cookie_var , ( char * ) & app_result -> request_data . suspected_header_var , BP_WEB_ANALYSIS_ENGINES_PHP , BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG , ( char * ) this -> webAssessment -> phpErrCodes [ app_result -> phpTestMatchIndexes [ index_iterator ] ] . phpErrStr , ( char * ) this -> webAssessment -> phpErrCodes [ app_result -> phpTestMatchIndexes [ index_iterator ] ] . phpErrStr , app_result -> phpTestMatchIndexes [ index_iterator ] ) ; } for ( index_iterator = 0 ; index_iterator < app_result -> aspTestMatchesMade ; index_iterator ++ ) { this -> WebAssessmentAddEngineAnalysisDataEntry ( app_result -> request_data . result_id , app_result -> request_data . request_id , app_result -> request_data . http_status_code , ( char * ) & app_result -> request_data . http_get , ( char * ) & app_result -> request_data . http_post , ( char * ) & app_result -> request_data . http_cookie , ( char * ) & app_result -> request_data . http_header , ( char * ) & app_result -> request_data . suspected_get_var , ( char * ) & app_result -> request_data . suspected_post_var , ( char * ) & app_result -> request_data . suspected_cookie_var , ( char * ) & app_result -> request_data . suspected_header_var , BP_WEB_ANALYSIS_ENGINES_ASP , BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG , ( char * ) this -> webAssessment -> aspErrCodes [ app_result -> aspTestMatchIndexes [ index_iterator ] ] . description , ( char * ) this -> webAssessment -> aspErrCodes [ app_result -> aspTestMatchIndexes [ index_iterator ] ] . description , app_result -> aspTestMatchIndexes [ index_iterator ] ) ; } for ( index_iterator = 0 ; index_iterator < app_result -> jspTestMatchesMade ; index_iterator ++ ) { this -> WebAssessmentAddEngineAnalysisDataEntry ( app_result -> request_data . result_id , app_result -> request_data . request_id , app_result -> request_data . http_status_code , ( char * ) & app_result -> request_data . http_get , ( char * ) & app_result -> request_data . http_post , ( char * ) & app_result -> request_data . http_cookie , ( char * ) & app_result -> request_data . http_header , ( char * ) & app_result -> request_data . suspected_get_var , ( char * ) & app_result -> request_data . suspected_post_var , ( char * ) & app_result -> request_data . suspected_cookie_var , ( char * ) & app_result -> request_data . suspected_header_var , BP_WEB_ANALYSIS_ENGINES_JSP , BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG , ( char * ) this -> webAssessment -> jspErrCodes [ app_result -> jspTestMatchIndexes [ index_iterator ] ] . description , ( char * ) this -> webAssessment -> jspErrCodes [ app_result -> jspTestMatchIndexes [ index_iterator ] ] . description , app_result -> jspTestMatchIndexes [ index_iterator ] ) ; } for ( index_iterator = 0 ; index_iterator < app_result -> cfmTestMatchesMade ; index_iterator ++ ) { this -> WebAssessmentAddEngineAnalysisDataEntry ( app_result -> request_data . result_id , app_result -> request_data . request_id , app_result -> request_data . http_status_code , ( char * ) & app_result -> request_data . http_get , ( char * ) & app_result -> request_data . http_post , ( char * ) & app_result -> request_data . http_cookie , ( char * ) & app_result -> request_data . http_header , ( char * ) & app_result -> request_data . suspected_get_var , ( char * ) & app_result -> request_data . suspected_post_var , ( char * ) & app_result -> request_data . suspected_cookie_var , ( char * ) & app_result -> request_data . suspected_header_var , BP_WEB_ANALYSIS_ENGINES_CFM , BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG , ( char * ) this -> webAssessment -> cfmErrCodes [ app_result -> cfmTestMatchIndexes [ index_iterator ] ] . description , ( char * ) this -> webAssessment -> cfmErrCodes [ app_result -> cfmTestMatchIndexes [ index_iterator ] ] . description , app_result -> cfmTestMatchIndexes [ index_iterator ] ) ; } for ( index_iterator = 0 ; index_iterator < app_result -> dnetTestMatchesMade ; index_iterator ++ ) { this -> WebAssessmentAddEngineAnalysisDataEntry ( app_result -> request_data . result_id , app_result -> request_data . request_id , app_result -> request_data . http_status_code , ( char * ) & app_result -> request_data . http_get , ( char * ) & app_result -> request_data . http_post , ( char * ) & app_result -> request_data . http_cookie , ( char * ) & app_result -> request_data . http_header , ( char * ) & app_result -> request_data . suspected_get_var , ( char * ) & app_result -> request_data . suspected_post_var , ( char * ) & app_result -> request_data . suspected_cookie_var , ( char * ) & app_result -> request_data . suspected_header_var , BP_WEB_ANALYSIS_ENGINES_DNET , BP_WEB_ANALYSIS_CONDITION_APP_ENGINE_MSG , ( char * ) this -> webAssessment -> dnetErrCodes [ app_result -> dnetTestMatchIndexes [ index_iterator ] ] . exceptionStr , ( char * ) this -> webAssessment -> dnetErrCodes [ app_result -> dnetTestMatchIndexes [ index_iterator ] ] . exceptionStr , app_result -> dnetTestMatchIndexes [ index_iterator ] ) ; } } } BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_SUCCESS ) ; }
saves app engine data to the database
saves app engine data to the database
// enter critical section // insert all application engine matches // this index iterator is used to move between the different arrays // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% PHP Match Insert %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% ASP Match Insert %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // add the entry // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% JSP Match Insert %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // add the entry // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Cold Fusion Match Insert %%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // add the entry // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Dot Net Match Insert %%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // add the entry // return indicating success