src/transaction.cc
/**
 * @name    intervention
 * @brief   Check if ModSecurity has anything to ask to the server.
 *
 * Intervention can generate a log event and/or perform a disruptive action.
 *
 * @param Pointer ModSecurityIntervention structure
 * @retval true  A intervention should be made.
 * @retval false Nothing to be done.
 *
 */
@name    intervention
@brief   Check if ModSecurity has anything to ask to the server.

Intervention can generate a log event and/or perform a disruptive action.

@param Pointer ModSecurityIntervention structure
@retval true  A intervention should be made.
@retval false Nothing to be done.
@name intervention @brief Check if ModSecurity has anything to ask to the server . Intervention can generate a log event and / or perform a disruptive action . @param Pointer ModSecurityIntervention structure @retval true A intervention should be made . @retval false Nothing to be done .
bool Transaction::intervention(ModSecurityIntervention *it) {
    if (m_it.disruptive) {
        it->url = m_it.url;
        it->disruptive = m_it.disruptive;
        it->status = m_it.status;
        if (m_it.log != NULL) {
            std::string log("");
            log.append(m_it.log);
            utils::string::replaceAll(&log, std::string("%d"),
                std::to_string(it->status));
            it->log = strdup(log.c_str());
        }
        intervention::reset(&m_it);
    }
    return it->disruptive;
}
bool Transaction :: intervention ( ModSecurityIntervention * it ) { if ( m_it . disruptive ) { it -> url = m_it . url ; it -> disruptive = m_it . disruptive ; it -> status = m_it . status ; if ( m_it . log != NULL ) { std :: string log ( " " ) ; log . append ( m_it . log ) ; utils :: string :: replaceAll ( & log , std :: string ( " " ) , std :: to_string ( it -> status ) ) ; it -> log = strdup ( log . c_str ( ) ) ; } intervention :: reset ( & m_it ) ; } return it -> disruptive ; }
@name    intervention
 @brief   Check if ModSecurity has anything to ask to the server.
@name intervention @brief Check if ModSecurity has anything to ask to the server .