diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-30 17:26:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-30 17:26:45 +0000 |
commit | 2e6e4ee945072c30c24289da5d01aed1b282dfcd (patch) | |
tree | 2c8bfc2183657fc03dfc08a3d67b11e3a8eeda56 /src/fs/gnunet-service-fs_pr.c | |
parent | 7398e127e6b600054c20deafb3fae075adeafd8f (diff) | |
download | gnunet-2e6e4ee945072c30c24289da5d01aed1b282dfcd.tar.gz gnunet-2e6e4ee945072c30c24289da5d01aed1b282dfcd.zip |
fixing #3146: peer identities no longer have the size of hash codes; breaks FS protocol compatibility with previous versions slightly...
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index e5a789a2b..e3ce8dd69 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -504,7 +504,7 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
504 | { | 504 | { |
505 | char lbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; | 505 | char lbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; |
506 | struct GetMessage *gm; | 506 | struct GetMessage *gm; |
507 | struct GNUNET_HashCode *ext; | 507 | struct GNUNET_PeerIdentity *ext; |
508 | size_t msize; | 508 | size_t msize; |
509 | unsigned int k; | 509 | unsigned int k; |
510 | uint32_t bm; | 510 | uint32_t bm; |
@@ -537,7 +537,7 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
537 | k++; | 537 | k++; |
538 | } | 538 | } |
539 | bf_size = GNUNET_CONTAINER_bloomfilter_get_size (pr->bf); | 539 | bf_size = GNUNET_CONTAINER_bloomfilter_get_size (pr->bf); |
540 | msize = sizeof (struct GetMessage) + bf_size + k * sizeof (struct GNUNET_HashCode); | 540 | msize = sizeof (struct GetMessage) + bf_size + k * sizeof (struct GNUNET_PeerIdentity); |
541 | GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); | 541 | GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); |
542 | if (buf_size < msize) | 542 | if (buf_size < msize) |
543 | return msize; | 543 | return msize; |
@@ -561,16 +561,14 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
561 | gm->filter_mutator = htonl (pr->mingle); | 561 | gm->filter_mutator = htonl (pr->mingle); |
562 | gm->hash_bitmap = htonl (bm); | 562 | gm->hash_bitmap = htonl (bm); |
563 | gm->query = pr->public_data.query; | 563 | gm->query = pr->public_data.query; |
564 | ext = (struct GNUNET_HashCode *) & gm[1]; | 564 | ext = (struct GNUNET_PeerIdentity *) &gm[1]; |
565 | k = 0; | 565 | k = 0; |
566 | if (!do_route) | 566 | if (!do_route) |
567 | GNUNET_PEER_resolve (pr->sender_pid, | 567 | GNUNET_PEER_resolve (pr->sender_pid, |
568 | (struct GNUNET_PeerIdentity *) &ext[k++]); | 568 | &ext[k++]); |
569 | if (NULL != pr->public_data.target) | 569 | if (NULL != pr->public_data.target) |
570 | memcpy (&ext[k++], | 570 | ext[k++] = *pr->public_data.target; |
571 | pr->public_data.target, | 571 | if (NULL != pr->bf) |
572 | sizeof (struct GNUNET_PeerIdentity)); | ||
573 | if (pr->bf != NULL) | ||
574 | GNUNET_assert (GNUNET_SYSERR != | 572 | GNUNET_assert (GNUNET_SYSERR != |
575 | GNUNET_CONTAINER_bloomfilter_get_raw_data (pr->bf, | 573 | GNUNET_CONTAINER_bloomfilter_get_raw_data (pr->bf, |
576 | (char *) &ext[k], | 574 | (char *) &ext[k], |