apr_status_t easy_process_stats()

in flood_easy_reports.c [51:86]


apr_status_t easy_process_stats(report_t *report, int verified, request_t *req, response_t *resp, flood_timer_t *timer)
{
    easy_report_t* easy;
    char *foo;

    easy = (easy_report_t*)report;

    foo = apr_psprintf(easy->pool, "%" APR_INT64_T_FMT " %" APR_INT64_T_FMT 
                       " %" APR_INT64_T_FMT " %" APR_INT64_T_FMT 
                       " %" APR_INT64_T_FMT,
                       timer->begin, timer->connect, timer->write, 
                       timer->read, timer->close);

    switch (verified)
    {
    case FLOOD_VALID:
        foo = apr_pstrcat(easy->pool, foo, " OK", NULL);
        break;
    case FLOOD_INVALID:
        foo = apr_pstrcat(easy->pool, foo, " FAIL", NULL);
        break;
    default:
        foo = apr_psprintf(easy->pool, "%s %d", foo, verified);
    }

#if APR_HAS_THREADS
    foo = apr_psprintf(easy->pool, "%s %ld %s", foo, apr_os_thread_current(), 
                       req->uri);
#else
    foo = apr_psprintf(easy->pool, "%s %ld %s", foo, getpid(), req->uri);
#endif

    apr_file_printf(local_stdout, "%s\n", foo);

    return APR_SUCCESS;
}