aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport-testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport-testing.c')
-rw-r--r--src/transport/transport-testing.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 0079bc421..5d0e990f7 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -91,6 +91,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
91{ 91{
92 struct PeerContext *p = cls; 92 struct PeerContext *p = cls;
93 /* Find PeerContext */ 93 /* Find PeerContext */
94 GNUNET_assert (p != 0);
94 GNUNET_assert (p->tth != NULL); 95 GNUNET_assert (p->tth != NULL);
95 struct PeerContext * p2 = find_peer_context (p->tth, peer); 96 struct PeerContext * p2 = find_peer_context (p->tth, peer);
96 97
@@ -136,8 +137,15 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
136{ 137{
137 struct PeerContext *p = cls; 138 struct PeerContext *p = cls;
138 /* Find PeerContext */ 139 /* Find PeerContext */
139 GNUNET_assert (p->tth != NULL); 140 int no = 0;
140 struct PeerContext * p2 = find_peer_context (p->tth, peer); 141 struct PeerContext * p2 = NULL;
142
143 if (p != NULL)
144 {
145 GNUNET_assert (p->tth != NULL);
146 p2 = find_peer_context (p->tth, peer);
147 no = p->no;
148 }
141 149
142 char * p2_s; 150 char * p2_s;
143 if (p2 != NULL) 151 if (p2 != NULL)
@@ -147,7 +155,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
147 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", 155 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing",
148 "Peers %s disconnected from peer %u (`%s')\n", 156 "Peers %s disconnected from peer %u (`%s')\n",
149 p2_s, 157 p2_s,
150 p->no, GNUNET_i2s (&p->id)); 158 no , GNUNET_i2s (&p->id));
151 GNUNET_free (p2_s); 159 GNUNET_free (p2_s);
152 160
153 if (p == NULL) 161 if (p == NULL)