コード例 #1
0
ファイル: mod_limit.c プロジェクト: AlexShiLucky/lighttpd2
static void mod_limit_timeout_callback(liWaitQueue *wq, gpointer data) {
	liWaitQueueElem *wqe;
	mod_limit_req_ip_data *rid;
	gpointer addr;
	guint32 bits;

	UNUSED(data);

	while ((wqe = li_waitqueue_pop(wq)) != NULL) {
		rid = wqe->data;

		/* IPv4 or IPv6? */
		if (rid->ip.addr->plain.sa_family == AF_INET) {
			addr = &rid->ip.addr->ipv4.sin_addr.s_addr;
			bits = 32;
		} else {
			addr = &rid->ip.addr->ipv6.sin6_addr.s6_addr;
			bits = 128;
		}

		g_mutex_lock(rid->ctx->mutex);
		li_radixtree_remove(rid->ctx->pool.req_ip, addr, bits);
		g_mutex_unlock(rid->ctx->mutex);
		li_sockaddr_clear(&rid->ip);
		g_slice_free(mod_limit_req_ip_data, rid);
	}

	li_waitqueue_update(wq);
}
コード例 #2
0
ファイル: mod_progress.c プロジェクト: Sciumo/lighttpd2
static void progress_timeout_callback(liWaitQueue *wq, gpointer data) {
	mod_progress_worker_data *wrk_data = data;
	liWaitQueueElem *wqe;
	mod_progress_node *node;

	while ((wqe = li_waitqueue_pop(wq)) != NULL) {
		node = wqe->data;
		g_hash_table_remove(wrk_data->hash_table, node->id);
	}

	li_waitqueue_update(wq);
}
コード例 #3
0
ファイル: stat_cache.c プロジェクト: tianzhishuizhu/lighttpd2
static void stat_cache_delete_cb(liWaitQueue *wq, gpointer data) {
    liStatCache *sc = data;
    liWaitQueueElem *wqe;

    while ((wqe = li_waitqueue_pop(wq)) != NULL) {
        liStatCacheEntry *sce = wqe->data;

        /* stat cache entry TTL over */
        stat_cache_remove_from_cache(sc, sce);
    }

    li_waitqueue_update(wq);
}
コード例 #4
0
ファイル: throttle.c プロジェクト: Aivaras/lighttpd2
void li_throttle_waitqueue_cb(liWaitQueue *wq, gpointer data) {
	liWaitQueueElem *wqe;
	UNUSED(data); /* should contain worker */

	throttle_debug("li_throttle_waitqueue_cb\n");

	while (NULL != (wqe = li_waitqueue_pop(wq))) {
		liThrottleState *state = LI_CONTAINER_OF(wqe, liThrottleState, wqueue_elem);
		liThrottleNotifyCB notify_callback = state->notify_callback;
		gpointer notify_data = wqe->data;

		if (NULL == notify_data || NULL == notify_callback || 0 == state->interested) continue;

		notify_callback(state, notify_data);
	}
	li_waitqueue_update(wq);
}