aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/gnunet-service-peerinfo.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-13 22:51:39 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-13 22:51:39 +0000
commitcbe8cf2657d9de021722229eee1a6986005f214a (patch)
treee77a96350ccfa1a0043248bd47f956a6fbf0715a /src/peerinfo/gnunet-service-peerinfo.c
parent1480571b0699ba22819334d8b961633e57dbb800 (diff)
downloadgnunet-cbe8cf2657d9de021722229eee1a6986005f214a.tar.gz
gnunet-cbe8cf2657d9de021722229eee1a6986005f214a.zip
-dead code elimination
Diffstat (limited to 'src/peerinfo/gnunet-service-peerinfo.c')
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index b39627031..42e8dad1e 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -753,8 +753,6 @@ update_hello (const struct GNUNET_PeerIdentity *peer,
753 if (NULL != host->friend_only_hello) 753 if (NULL != host->friend_only_hello)
754 GNUNET_assert ((GNUNET_YES == GNUNET_HELLO_is_friend_only(host->friend_only_hello))); 754 GNUNET_assert ((GNUNET_YES == GNUNET_HELLO_is_friend_only(host->friend_only_hello)));
755 755
756 store_hello = GNUNET_NO;
757 store_friend_hello = GNUNET_NO;
758 fn = get_host_filename (peer); 756 fn = get_host_filename (peer);
759 if ( (NULL != fn) && 757 if ( (NULL != fn) &&
760 (GNUNET_OK == GNUNET_DISK_directory_create_for_file (fn)) ) 758 (GNUNET_OK == GNUNET_DISK_directory_create_for_file (fn)) )
@@ -774,6 +772,7 @@ update_hello (const struct GNUNET_PeerIdentity *peer,
774 if (NULL != host->friend_only_hello) 772 if (NULL != host->friend_only_hello)
775 (void) GNUNET_HELLO_iterate_addresses (host->friend_only_hello, GNUNET_NO, 773 (void) GNUNET_HELLO_iterate_addresses (host->friend_only_hello, GNUNET_NO,
776 &count_addresses, &cnt); 774 &count_addresses, &cnt);
775 store_friend_hello = GNUNET_NO;
777 if (0 < cnt) 776 if (0 < cnt)
778 { 777 {
779 store_friend_hello = GNUNET_YES; 778 store_friend_hello = GNUNET_YES;
@@ -892,8 +891,8 @@ discard_hosts_helper (void *cls, const char *fn)
892 const struct GNUNET_HELLO_Message *hello; 891 const struct GNUNET_HELLO_Message *hello;
893 struct GNUNET_HELLO_Message *new_hello; 892 struct GNUNET_HELLO_Message *new_hello;
894 int read_size; 893 int read_size;
895 int cur_hello_size; 894 unsigned int cur_hello_size;
896 int new_hello_size; 895 unsigned int new_hello_size;
897 int read_pos; 896 int read_pos;
898 int write_pos; 897 int write_pos;
899 unsigned int cnt; 898 unsigned int cnt;
@@ -917,7 +916,6 @@ discard_hosts_helper (void *cls, const char *fn)
917 /* Check each HELLO */ 916 /* Check each HELLO */
918 hello = (const struct GNUNET_HELLO_Message *) &buffer[read_pos]; 917 hello = (const struct GNUNET_HELLO_Message *) &buffer[read_pos];
919 cur_hello_size = GNUNET_HELLO_size (hello); 918 cur_hello_size = GNUNET_HELLO_size (hello);
920 new_hello_size = 0;
921 if (0 == cur_hello_size) 919 if (0 == cur_hello_size)
922 { 920 {
923 /* Invalid data, discard */ 921 /* Invalid data, discard */
@@ -933,7 +931,7 @@ discard_hosts_helper (void *cls, const char *fn)
933 if ( (NULL != new_hello) && (0 < cnt) ) 931 if ( (NULL != new_hello) && (0 < cnt) )
934 { 932 {
935 /* Store new HELLO to write it when done */ 933 /* Store new HELLO to write it when done */
936 new_hello_size = GNUNET_HELLO_size(new_hello); 934 new_hello_size = GNUNET_HELLO_size (new_hello);
937 memcpy (&writebuffer[write_pos], new_hello, new_hello_size); 935 memcpy (&writebuffer[write_pos], new_hello, new_hello_size);
938 write_pos += new_hello_size; 936 write_pos += new_hello_size;
939 } 937 }