+ if (GNUNET_SCHEDULER_NO_TASK != h->write_task)
+ {
+ GNUNET_SCHEDULER_cancel (h->write_task);
+ h->write_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->read_task);
+ GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->restart_task);
+ while (NULL != (sh = h->sh_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (h->sh_head,
+ h->sh_tail,
+ sh);
+ if (NULL != sh->cont)
+ sh->cont (sh->cont_cls, GNUNET_SYSERR);
+ GNUNET_free (sh);
+ }
+ if (NULL != h->mst)
+ GNUNET_SERVER_mst_destroy (h->mst);