aboutsummaryrefslogtreecommitdiff
path: root/src/nat/nat.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-10-11 13:03:51 +0000
committerChristian Grothoff <christian@grothoff.org>2010-10-11 13:03:51 +0000
commit96219e61dcde38486e7f5a0c2d4f6927c47e9296 (patch)
tree82d06e217a01368e6ee8bfd12e686cb75265b35b /src/nat/nat.c
parentfc10d04ba1a58540fbb55b3cabffbf64d51ea989 (diff)
downloadgnunet-96219e61dcde38486e7f5a0c2d4f6927c47e9296.tar.gz
gnunet-96219e61dcde38486e7f5a0c2d4f6927c47e9296.zip
fixing segv
Diffstat (limited to 'src/nat/nat.c')
-rw-r--r--src/nat/nat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c
index 5159e0903..74d08bd6f 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -333,10 +333,9 @@ nat_pulse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
333 struct GNUNET_NAT_Handle *h = cls; 333 struct GNUNET_NAT_Handle *h = cls;
334 334
335 /* Stop if we're already waiting for an action to complete */ 335 /* Stop if we're already waiting for an action to complete */
336 h->pulse_timer = GNUNET_SCHEDULER_NO_TASK;
336 if (h->processing) 337 if (h->processing)
337 return; 338 return;
338
339 h->pulse_timer = GNUNET_SCHEDULER_NO_TASK;
340 h->old_status = get_traversal_status (h); 339 h->old_status = get_traversal_status (h);
341 340
342 /* Only update the protocol that has been successful until now */ 341 /* Only update the protocol that has been successful until now */
@@ -361,7 +360,7 @@ nat_pulse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
361 360
362 GNUNET_NAT_UPNP_pulse (h->upnp, h->is_enabled, GNUNET_YES); 361 GNUNET_NAT_UPNP_pulse (h->upnp, h->is_enabled, GNUNET_YES);
363#if 0 362#if 0
364 GNUNET_NAT_NATPMP_pulse (h->natpmp, h->is_enabled, natpmp_pulse_cb, h); 363 GNUNET_NAT_NATPMP_pulse (h->natpmp, h->is_enabled, &natpmp_pulse_cb, h);
365#endif 364#endif
366 } 365 }
367} 366}
@@ -417,11 +416,11 @@ GNUNET_NAT_register (struct GNUNET_SCHEDULER_Handle
417 h->callback_cls = callback_cls; 416 h->callback_cls = callback_cls;
418 h->upnp = 417 h->upnp =
419 GNUNET_NAT_UPNP_init (h->sched, h->local_addr, addrlen, h->public_port, 418 GNUNET_NAT_UPNP_init (h->sched, h->local_addr, addrlen, h->public_port,
420 upnp_pulse_cb, h); 419 &upnp_pulse_cb, h);
421#if 0 420#if 0
422 h->natpmp = 421 h->natpmp =
423 GNUNET_NAT_NATPMP_init (h->sched, h->local_addr, addrlen, h->public_port, 422 GNUNET_NAT_NATPMP_init (h->sched, h->local_addr, addrlen, h->public_port,
424 natpmp_pulse_cb, h); 423 &natpmp_pulse_cb, h);
425#endif 424#endif
426 h->pulse_timer = GNUNET_SCHEDULER_add_delayed (sched, 425 h->pulse_timer = GNUNET_SCHEDULER_add_delayed (sched,
427 GNUNET_TIME_UNIT_SECONDS, 426 GNUNET_TIME_UNIT_SECONDS,
@@ -447,7 +446,8 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h)
447 GNUNET_NAT_NATPMP_close (h->natpmp); 446 GNUNET_NAT_NATPMP_close (h->natpmp);
448#endif 447#endif
449 448
450 GNUNET_SCHEDULER_cancel (h->sched, h->pulse_timer); 449 if (GNUNET_SCHEDULER_NO_TASK != h->pulse_timer)
450 GNUNET_SCHEDULER_cancel (h->sched, h->pulse_timer);
451 451
452 GNUNET_free_non_null (h->local_addr); 452 GNUNET_free_non_null (h->local_addr);
453 GNUNET_free_non_null (h->ext_addr); 453 GNUNET_free_non_null (h->ext_addr);