GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
}
+ GNUNET_SERVER_client_keep (client);
msg = (const struct GetMessage*) message;
if ( (size == sizeof(struct GetMessage)) &&
(GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (filter,
"GET",
GNUNET_h2s (&msg->key));
#endif
- GNUNET_SERVER_client_keep (client);
transmit_item (client,
NULL, NULL, 0, NULL, 0, 0, 0,
GNUNET_TIME_UNIT_ZERO_ABS, 0);
return;
}
- GNUNET_SERVER_client_keep (client);
plugin->api->get (plugin->api->cls,
((size == sizeof(struct GetMessage)) ? &msg->key : NULL),
NULL,
static void
cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ struct TransmitCallbackContext *tcc;
+
+ while (NULL != (tcc = tcc_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (tcc_head,
+ tcc_tail,
+ tcc);
+ if (tcc->th != NULL)
+ GNUNET_CONNECTION_notify_transmit_ready_cancel (tcc->th);
+ if (NULL != tcc->tc)
+ tcc->tc (tcc->tc_cls, GNUNET_SYSERR);
+ GNUNET_free (tcc->msg);
+ GNUNET_free (tcc);
+ }
if (expired_kill_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (sched,
}
-/**
- * Function that removes all active reservations made
- * by the given client and releases the space for other
- * requests.
- *
- * @param cls closure
- * @param client identification of the client
- */
-static void
-cleanup_transmits (void *cls,
- struct GNUNET_SERVER_Client
- * client)
-{
- struct TransmitCallbackContext *tcc;
-
- while (NULL != (tcc = tcc_head))
- {
- GNUNET_CONTAINER_DLL_remove (tcc_head,
- tcc_tail,
- tcc);
- if (tcc->th != NULL)
- GNUNET_CONNECTION_notify_transmit_ready_cancel (tcc->th);
- GNUNET_free (tcc->msg);
- GNUNET_free (tcc);
- }
-
-}
-
-
-
/**
* Process datastore requests.
*
return;
}
GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL);
- GNUNET_SERVER_disconnect_notify (server, &cleanup_transmits, NULL);
GNUNET_SERVER_add_handlers (server, handlers);
expired_kill_task
= GNUNET_SCHEDULER_add_with_priority (sched,
sqlite_plugin_iter_low_priority (cls, type, iter, iter_cls);
return;
}
- GNUNET_snprintf (scratch, 256,
+ GNUNET_snprintf (scratch, sizeof (scratch),
"SELECT count(*) FROM gn080 WHERE hash=:1%s%s",
vhash == NULL ? "" : " AND vhash=:2",
type == 0 ? "" : (vhash ==
return;
}
- GNUNET_snprintf (scratch, 256,
+ GNUNET_snprintf (scratch, sizeof (scratch),
"SELECT size, type, prio, anonLevel, expire, hash, value, _ROWID_ "
"FROM gn080 WHERE hash=:1%s%s AND _ROWID_ >= :%d "
"ORDER BY _ROWID_ ASC LIMIT 1 OFFSET :d",