diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh_peer.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 3cf84ab75..e8b332c7d 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -1888,20 +1888,23 @@ GMP_set_hello (struct MeshPeer *peer, const struct GNUNET_HELLO_Message *hello) | |||
1888 | struct GNUNET_HELLO_Message *old; | 1888 | struct GNUNET_HELLO_Message *old; |
1889 | size_t size; | 1889 | size_t size; |
1890 | 1890 | ||
1891 | LOG (GNUNET_ERROR_TYPE_DEBUG, "New hello for %s\n", GMP_2s (peer)); | ||
1891 | if (NULL == hello) | 1892 | if (NULL == hello) |
1892 | return; | 1893 | return; |
1893 | 1894 | ||
1894 | old = GMP_get_hello (peer); | 1895 | old = GMP_get_hello (peer); |
1896 | LOG (GNUNET_ERROR_TYPE_DEBUG, " old hello %p\n", old); | ||
1895 | if (NULL == old) | 1897 | if (NULL == old) |
1896 | { | 1898 | { |
1897 | size = GNUNET_HELLO_size (hello); | 1899 | size = GNUNET_HELLO_size (hello); |
1900 | LOG (GNUNET_ERROR_TYPE_DEBUG, " new size: %u\n", size); | ||
1898 | peer->hello = GNUNET_malloc (size); | 1901 | peer->hello = GNUNET_malloc (size); |
1899 | memcpy (peer->hello, hello, size); | 1902 | memcpy (peer->hello, hello, size); |
1900 | return; | ||
1901 | } | 1903 | } |
1902 | else | 1904 | else |
1903 | { | 1905 | { |
1904 | peer->hello = GNUNET_HELLO_merge (old, hello); | 1906 | peer->hello = GNUNET_HELLO_merge (old, hello); |
1907 | LOG (GNUNET_ERROR_TYPE_DEBUG, " merge! %p\n", peer->hello); | ||
1905 | GNUNET_free (old); | 1908 | GNUNET_free (old); |
1906 | } | 1909 | } |
1907 | } | 1910 | } |
@@ -1920,6 +1923,7 @@ GMP_get_hello (struct MeshPeer *peer) | |||
1920 | struct GNUNET_TIME_Absolute expiration; | 1923 | struct GNUNET_TIME_Absolute expiration; |
1921 | struct GNUNET_TIME_Relative remaining; | 1924 | struct GNUNET_TIME_Relative remaining; |
1922 | 1925 | ||
1926 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Get hello\n"); | ||
1923 | if (NULL == peer->hello) | 1927 | if (NULL == peer->hello) |
1924 | return NULL; | 1928 | return NULL; |
1925 | 1929 | ||
@@ -1927,6 +1931,8 @@ GMP_get_hello (struct MeshPeer *peer) | |||
1927 | remaining = GNUNET_TIME_absolute_get_remaining (expiration); | 1931 | remaining = GNUNET_TIME_absolute_get_remaining (expiration); |
1928 | if (0 == remaining.rel_value_us) | 1932 | if (0 == remaining.rel_value_us) |
1929 | { | 1933 | { |
1934 | LOG (GNUNET_ERROR_TYPE_DEBUG, " expired on %s\n", | ||
1935 | GNUNET_STRINGS_absolute_time_to_string (expiration)); | ||
1930 | GNUNET_free (peer->hello); | 1936 | GNUNET_free (peer->hello); |
1931 | peer->hello = NULL; | 1937 | peer->hello = NULL; |
1932 | } | 1938 | } |