diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-25 18:15:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-25 18:15:30 +0000 |
commit | 2b61888a0bf1d41b2b25256ca9834c3040551ce9 (patch) | |
tree | 8f5c9456439ddd776300a78f1c8a9097c2af1be4 /src/fs | |
parent | 9ea6c6cc680d8110b0c56393e9349a3b4f49ab69 (diff) | |
download | gnunet-2b61888a0bf1d41b2b25256ca9834c3040551ce9.tar.gz gnunet-2b61888a0bf1d41b2b25256ca9834c3040551ce9.zip |
fix
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_uri.c | 1 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 15 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 8f9fbba65..96a1414fe 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -1094,6 +1094,7 @@ GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri) | |||
1094 | if (ret->data.ksk.keywordCount >= GNUNET_MAX_MALLOC_CHECKED / sizeof (char*)) | 1094 | if (ret->data.ksk.keywordCount >= GNUNET_MAX_MALLOC_CHECKED / sizeof (char*)) |
1095 | { | 1095 | { |
1096 | GNUNET_break (0); | 1096 | GNUNET_break (0); |
1097 | GNUNET_free (ret); | ||
1097 | return NULL; | 1098 | return NULL; |
1098 | } | 1099 | } |
1099 | if (ret->data.ksk.keywordCount > 0) | 1100 | if (ret->data.ksk.keywordCount > 0) |
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 1eb491877..788817f5b 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -2614,7 +2614,6 @@ handle_p2p_put (void *cls, | |||
2614 | GNUNET_HashCode query; | 2614 | GNUNET_HashCode query; |
2615 | struct ProcessReplyClosure prq; | 2615 | struct ProcessReplyClosure prq; |
2616 | const struct SBlock *sb; | 2616 | const struct SBlock *sb; |
2617 | struct ConnectedPeer *cps; | ||
2618 | 2617 | ||
2619 | msize = ntohs (message->size); | 2618 | msize = ntohs (message->size); |
2620 | if (msize < sizeof (struct PutMessage)) | 2619 | if (msize < sizeof (struct PutMessage)) |
@@ -2661,6 +2660,8 @@ handle_p2p_put (void *cls, | |||
2661 | if (other != NULL) | 2660 | if (other != NULL) |
2662 | prq.sender = GNUNET_CONTAINER_multihashmap_get (connected_peers, | 2661 | prq.sender = GNUNET_CONTAINER_multihashmap_get (connected_peers, |
2663 | &other->hashPubKey); | 2662 | &other->hashPubKey); |
2663 | else | ||
2664 | prq.sender = NULL; | ||
2664 | prq.size = dsize; | 2665 | prq.size = dsize; |
2665 | prq.type = type; | 2666 | prq.type = type; |
2666 | prq.expiration = expiration; | 2667 | prq.expiration = expiration; |
@@ -2670,16 +2671,10 @@ handle_p2p_put (void *cls, | |||
2670 | &query, | 2671 | &query, |
2671 | &process_reply, | 2672 | &process_reply, |
2672 | &prq); | 2673 | &prq); |
2673 | cps = GNUNET_CONTAINER_multihashmap_get (connected_peers, | 2674 | if (prq.sender != NULL) |
2674 | &other->hashPubKey); | ||
2675 | if (cps != NULL) | ||
2676 | { | 2675 | { |
2677 | cps->inc_preference += CONTENT_BANDWIDTH_VALUE + 1000 * prq.priority; | 2676 | prq.sender->inc_preference += CONTENT_BANDWIDTH_VALUE + 1000 * prq.priority; |
2678 | cps->trust_delta += prq.priority; | 2677 | prq.sender->trust_delta += prq.priority; |
2679 | } | ||
2680 | else | ||
2681 | { | ||
2682 | GNUNET_break (0); | ||
2683 | } | 2678 | } |
2684 | if (GNUNET_YES == active_migration) | 2679 | if (GNUNET_YES == active_migration) |
2685 | { | 2680 | { |