aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_uri.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-11-08 14:47:06 +0000
committerChristian Grothoff <christian@grothoff.org>2010-11-08 14:47:06 +0000
commit22b79da9f678824250e98753788a959eadfcd1de (patch)
treeef6209e127af2850127c97cae6990fe20f3e2266 /src/fs/fs_uri.c
parent616b1d78400800215b119c9ea8516777dbcee41d (diff)
downloadgnunet-22b79da9f678824250e98753788a959eadfcd1de.tar.gz
gnunet-22b79da9f678824250e98753788a959eadfcd1de.zip
seaspider fixes
Diffstat (limited to 'src/fs/fs_uri.c')
-rw-r--r--src/fs/fs_uri.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index 764a2bee3..788f60685 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -240,6 +240,7 @@ percent_decode_keyword (const char *in, char **emsg)
240 return ret; 240 return ret;
241} 241}
242 242
243#define GNUNET_FS_URI_KSK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX
243 244
244/** 245/**
245 * Parse a KSK URI. 246 * Parse a KSK URI.
@@ -263,9 +264,9 @@ uri_ksk_parse (const char *s, char **emsg)
263 264
264 GNUNET_assert (s != NULL); 265 GNUNET_assert (s != NULL);
265 slen = strlen (s); 266 slen = strlen (s);
266 pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX); 267 pos = strlen (GNUNET_FS_URI_KSK_PREFIX);
267 if ( (slen <= pos) || 268 if ( (slen <= pos) ||
268 (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_KSK_INFIX, 269 (0 != strncmp (s, GNUNET_FS_URI_KSK_PREFIX,
269 pos) ) ) 270 pos) ) )
270 return NULL; /* not KSK URI */ 271 return NULL; /* not KSK URI */
271 if ( (s[slen - 1] == '+') || 272 if ( (s[slen - 1] == '+') ||
@@ -337,6 +338,8 @@ CLEANUP:
337} 338}
338 339
339 340
341#define GNUNET_FS_URI_SKS_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_SKS_INFIX
342
340/** 343/**
341 * Parse an SKS URI. 344 * Parse an SKS URI.
342 * 345 *
@@ -356,9 +359,9 @@ uri_sks_parse (const char *s, char **emsg)
356 359
357 GNUNET_assert (s != NULL); 360 GNUNET_assert (s != NULL);
358 slen = strlen (s); 361 slen = strlen (s);
359 pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_SKS_INFIX); 362 pos = strlen ( GNUNET_FS_URI_SKS_PREFIX);
360 if ( (slen <= pos) || 363 if ( (slen <= pos) ||
361 (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_SKS_INFIX, 364 (0 != strncmp (s, GNUNET_FS_URI_SKS_PREFIX,
362 pos) ) ) 365 pos) ) )
363 return NULL; /* not an SKS URI */ 366 return NULL; /* not an SKS URI */
364 if ( (slen < pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)) || 367 if ( (slen < pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)) ||
@@ -382,6 +385,8 @@ uri_sks_parse (const char *s, char **emsg)
382 return ret; 385 return ret;
383} 386}
384 387
388#define GNUNET_FS_URI_CHK_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX
389
385 390
386/** 391/**
387 * Parse a CHK URI. 392 * Parse a CHK URI.
@@ -404,9 +409,9 @@ uri_chk_parse (const char *s, char **emsg)
404 GNUNET_assert (s != NULL); 409 GNUNET_assert (s != NULL);
405 410
406 slen = strlen (s); 411 slen = strlen (s);
407 pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX); 412 pos = strlen (GNUNET_FS_URI_CHK_PREFIX);
408 if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) || 413 if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) ||
409 (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_CHK_INFIX, 414 (0 != strncmp (s, GNUNET_FS_URI_CHK_PREFIX,
410 pos) ) ) 415 pos) ) )
411 return NULL; /* not a CHK URI */ 416 return NULL; /* not a CHK URI */
412 if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') || 417 if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') ||
@@ -527,6 +532,8 @@ struct LocUriAssembly
527}; 532};
528 533
529 534
535#define GNUNET_FS_URI_LOC_PREFIX GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX
536
530/** 537/**
531 * Parse a LOC URI. 538 * Parse a LOC URI.
532 * Also verifies validity of the location URI. 539 * Also verifies validity of the location URI.
@@ -553,9 +560,9 @@ uri_loc_parse (const char *s, char **emsg)
553 560
554 GNUNET_assert (s != NULL); 561 GNUNET_assert (s != NULL);
555 slen = strlen (s); 562 slen = strlen (s);
556 pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX); 563 pos = strlen ( GNUNET_FS_URI_LOC_PREFIX);
557 if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) || 564 if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) ||
558 (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX, 565 (0 != strncmp (s, GNUNET_FS_URI_LOC_PREFIX,
559 pos) ) ) 566 pos) ) )
560 return NULL; /* not an SKS URI */ 567 return NULL; /* not an SKS URI */
561 if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') || 568 if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') ||