diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-25 11:02:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-25 11:02:34 +0000 |
commit | d0b14419851f070e0e6d2ab646e6fc0f4baa08c8 (patch) | |
tree | 08b04da9685e21d78c0fac672fb682729ea3f4b4 /src/fs/gnunet-service-fs_cp.c | |
parent | 8d9a9ab3714c070341acc2956c55bd039fcf9eaa (diff) | |
download | gnunet-d0b14419851f070e0e6d2ab646e6fc0f4baa08c8.tar.gz gnunet-d0b14419851f070e0e6d2ab646e6fc0f4baa08c8.zip |
fix
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.c')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 9ff96ba36..783bd4024 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -560,6 +560,7 @@ copy_reply (void *cls, | |||
560 | * have liked an answer to the request | 560 | * have liked an answer to the request |
561 | * @param pr handle to the original pending request | 561 | * @param pr handle to the original pending request |
562 | * @param expiration when does 'data' expire? | 562 | * @param expiration when does 'data' expire? |
563 | * @param type type of the block | ||
563 | * @param data response data, NULL on request expiration | 564 | * @param data response data, NULL on request expiration |
564 | * @param data_len number of bytes in data | 565 | * @param data_len number of bytes in data |
565 | */ | 566 | */ |
@@ -567,6 +568,7 @@ static void | |||
567 | handle_p2p_reply (void *cls, | 568 | handle_p2p_reply (void *cls, |
568 | struct GSF_PendingRequest *pr, | 569 | struct GSF_PendingRequest *pr, |
569 | struct GNUNET_TIME_Absolute expiration, | 570 | struct GNUNET_TIME_Absolute expiration, |
571 | enum GNUNET_BLOCK_Type type, | ||
570 | const void *data, | 572 | const void *data, |
571 | size_t data_len) | 573 | size_t data_len) |
572 | { | 574 | { |
@@ -588,6 +590,13 @@ handle_p2p_reply (void *cls, | |||
588 | pr)); | 590 | pr)); |
589 | return; | 591 | return; |
590 | } | 592 | } |
593 | GNUNET_break (type != GNUNET_BLOCK_TYPE_ANY); | ||
594 | if ( (prd->type != type) && | ||
595 | (prd->type != GNUNET_BLOCK_TYPE_ANY) ) | ||
596 | { | ||
597 | GNUNET_break (0); | ||
598 | return; | ||
599 | } | ||
591 | #if DEBUG_FS | 600 | #if DEBUG_FS |
592 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 601 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
593 | "Transmitting result for query `%s'\n", | 602 | "Transmitting result for query `%s'\n", |
@@ -606,7 +615,7 @@ handle_p2p_reply (void *cls, | |||
606 | pm = GNUNET_malloc (sizeof (msize)); | 615 | pm = GNUNET_malloc (sizeof (msize)); |
607 | pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); | 616 | pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); |
608 | pm->header.size = htons (msize); | 617 | pm->header.size = htons (msize); |
609 | pm->type = htonl (prd->type); | 618 | pm->type = htonl (type); |
610 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); | 619 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); |
611 | memcpy (&pm[1], data, data_len); | 620 | memcpy (&pm[1], data, data_len); |
612 | (void) GSF_peer_transmit_ (cp, GNUNET_NO, | 621 | (void) GSF_peer_transmit_ (cp, GNUNET_NO, |