Beispiel #1
0
LOCAL int moloch_http_curlm_timeout_callback(CURLM *UNUSED(multi), long timeout_ms, void *serverV)
{
    MolochHttpServer_t        *server = serverV;

    if (timeout_ms == -1) {
        if (server->multiTimer) {
            g_source_remove(server->multiTimer);
            server->multiTimer = 0;
        }
        return CURLE_OK;
    }

    if (!server->multiTimer) {
        server->multiTimer = g_timeout_add(50, moloch_http_timer_callback, server);
    }

    if (timeout_ms == 0)
        moloch_http_timer_callback(serverV);

    return CURLE_OK;
}
Beispiel #2
0
static int moloch_http_curlm_timeout_callback(CURLM *UNUSED(multi), long timeout_ms, void *serverV)
{
    if (timeout_ms < 10)
        moloch_http_timer_callback(serverV);
    return CURLE_OK;
}