예제 #1
0
htp_status_t htp_conn_remove_tx(htp_conn_t *conn, const htp_tx_t *tx) {
    if ((tx == NULL) || (conn == NULL)) return HTP_ERROR;
    if (conn->transactions == NULL) return HTP_ERROR;

    for (size_t i = 0, n = htp_list_size(conn->transactions); i < n; i++) {
        htp_tx_t *candidate_tx = htp_list_get(conn->transactions, i);
        if (tx == candidate_tx) {
            htp_list_replace(conn->transactions, i, NULL);
            return HTP_OK;
        }
    }

    return HTP_DECLINED;
}
예제 #2
0
htp_status_t htp_conn_remove_tx(htp_conn_t *conn, const htp_tx_t *tx) {
    if ((tx == NULL) || (conn == NULL)) return HTP_ERROR;
    if (conn->transactions == NULL) return HTP_ERROR;

    return htp_list_replace(conn->transactions, tx->index, NULL);
}