}
if (NULL == ret->filter)
{
- ret->filter = GNUNET_CONTAINER_bloomfilter_init (NULL,
- bf_size,
- 5); /* approx. 3% false positives at max use */
+ ret->filter = GNUNET_CONTAINER_bloomfilter_init (NULL,
+ bf_size,
+ 5); /* approx. 3% false positives at max use */
}
}
ret->stats = GNUNET_STATISTICS_create ("datacache", cfg);
* @param cfg configuration to update
* @param mem the memory block of serialized configuration
* @param size the size of the memory block
- * @param allow_inline set to #GNUNET_YES if we recursively load configuration
- * from inlined configurations; #GNUNET_NO if not and raise warnings
+ * @param allow_inline set to the base directory if we recursively load configuration
+ * from inlined configurations; NULL if not and raise warnings
* when we come across them
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
const char *mem,
size_t size,
- int allow_inline);
+ const char *basedir);
/**
GNUNET_CONFIGURATION_deserialize (ac->c,
(const char *) &message[1],
left,
- GNUNET_NO))
+ NULL))
{
GNUNET_break (0);
GNUNET_SERVICE_client_drop (ch->client);
GNUNET_CONFIGURATION_deserialize (cfg,
(const char *) &res[1],
left,
- GNUNET_NO))
+ NULL))
{
GNUNET_break (0);
ah->arc (ah->arc_cls,
num_demanded);
if (0 == num_demanded)
{
- struct GNUNET_MQ_Envelope *ev;
-
op->state->phase = PHASE_DONE;
send_client_done (op);
destroy_channel (op);
break;
case PHASE_FULL_SENDING:
{
- struct GNUNET_MQ_Envelope *ev;
-
LOG (GNUNET_ERROR_TYPE_DEBUG,
"got FULL DONE, finishing\n");
/* We sent the full set, and got the response for that. We're done. */
}
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_deserialize (cfg, config, ul_config_size, GNUNET_NO))
+ GNUNET_CONFIGURATION_deserialize (cfg,
+ config,
+ ul_config_size,
+ NULL))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"Unable to deserialize config -- exiting\n");
}
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_deserialize (cfg, (const char *) data,
+ GNUNET_CONFIGURATION_deserialize (cfg,
+ (const char *) data,
(size_t) data_len,
- GNUNET_NO))
+ NULL))
{
GNUNET_free (data);
GNUNET_break_op (0); /* De-serialization failure */
GNUNET_CONFIGURATION_destroy (cp->host->cfg);
cp->host->cfg = GNUNET_CONFIGURATION_create ();
GNUNET_assert (GNUNET_CONFIGURATION_deserialize
- (cp->host->cfg, config, config_size, GNUNET_NO));
+ (cp->host->cfg,
+ config,
+ config_size,
+ NULL));
GNUNET_free (config);
if (NULL == (hostname = GNUNET_TESTBED_host_get_hostname (cp->host)))
hostname = "localhost";
* @param cfg configuration to update
* @param mem the memory block of serialized configuration
* @param size the size of the memory block
- * @param allow_inline set to #GNUNET_YES if we recursively load configuration
- * from inlined configurations; #GNUNET_NO if not and raise warnings
+ * @param basedir set to path from which we recursively load configuration
+ * from inlined configurations; NULL if not and raise warnings
* when we come across them
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
const char *mem,
size_t size,
- int allow_inline)
+ const char *basedir)
{
char *line;
char *line_orig;
{
/* @INLINE@ value */
value = &line[strlen ("@INLINE@ ")];
- if (GNUNET_YES == allow_inline)
+ if (NULL != basedir)
{
- if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, value))
+ char *fn;
+
+ GNUNET_asprintf (&fn,
+ "%s/%s",
+ basedir,
+ value);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_parse (cfg,
+ fn))
{
+ GNUNET_free (fn);
ret = GNUNET_SYSERR; /* failed to parse included config */
break;
}
+ GNUNET_free (fn);
}
else
{
size_t fs;
char *fn;
char *mem;
+ char *endsep;
int dirty;
int ret;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Deserializing contents of file `%s'\n",
fn);
+ endsep = strrchr (fn, (int) '/');
+ if (NULL != endsep)
+ *endsep = '\0';
+ ret = GNUNET_CONFIGURATION_deserialize (cfg,
+ mem,
+ fs,
+ fn);
GNUNET_free (fn);
- ret = GNUNET_CONFIGURATION_deserialize (cfg, mem, fs, GNUNET_YES);
GNUNET_free (mem);
/* restore dirty flag - anything we set in the meantime
* came from disk */