~ubuntu-branches/ubuntu/intrepid/gnunet/intrepid

« back to all changes in this revision

Viewing changes to src/applications/fs/ecrs/search.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-08-19 19:44:30 UTC
  • mfrom: (1.2.12 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080819194430-x5gjv8wd7t7ldkp0
Tags: 0.8.0a-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #256576)
  - debian/rules:
   + Make use of code from cdbs' clean-la.mk file to clear the
      dependency_libs field in all .la files in the gnunet-dev 
      package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
229
229
  static GNUNET_HashCode allZeros;
230
230
  struct GNUNET_GE_Context *ectx = sqc->ectx;
231
231
  GNUNET_ECRS_FileInfo fi;
232
 
  struct GNUNET_ECRS_URI updateURI;
 
232
  URI updateURI;
233
233
  int ret;
234
234
  const char *id;
235
235
  const char *uris;
253
253
    }
254
254
  isRoot = 0 == memcmp (&sb->identifier, &allZeros, sizeof (GNUNET_HashCode));
255
255
  fi.uri = GNUNET_ECRS_string_to_uri (ectx, uris);
 
256
  if ((isRoot) && (fi.uri == NULL))
 
257
    {
 
258
      fi.uri = GNUNET_malloc (sizeof (URI));
 
259
      fi.uri->type = sks;
 
260
      GNUNET_hash (&sb->subspace,
 
261
                   sizeof (GNUNET_RSA_PublicKey),
 
262
                   &fi.uri->data.sks.namespace);
 
263
      fi.uri->data.sks.identifier = GNUNET_strdup (id);
 
264
    }
256
265
  if (fi.uri == NULL)
257
266
    {
258
267
      GNUNET_GE_BREAK_OP (ectx, 0);     /* sblock malformed */
267
276
    }
268
277
  else
269
278
    ret = GNUNET_OK;
270
 
  if (strlen (id) > 0)
 
279
  if ((strlen (id) > 0) && (strlen (uris) > 0))
271
280
    {
272
281
      updateURI.type = sks;
273
282
      GNUNET_hash (&sb->subspace,
278
287
      GNUNET_free (updateURI.data.sks.identifier);
279
288
    }
280
289
  GNUNET_meta_data_destroy (fi.meta);
 
290
  GNUNET_ECRS_uri_destroy (fi.uri);
281
291
  return ret;
282
292
}
283
293
 
301
311
  unsigned int size;
302
312
  int ret;
303
313
  GNUNET_HashCode query;
 
314
  GNUNET_CronTime expiration;
304
315
 
 
316
  expiration = GNUNET_ntohll (value->expiration_time);
 
317
  if (expiration < GNUNET_get_time ())
 
318
    return GNUNET_OK;           /* expired, ignore! */
305
319
  type = ntohl (value->type);
306
320
  size = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
307
321
#if DEBUG_SEARCH