static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_STREAM_close (peer1.socket);
+ if (NULL != peer1.socket)
+ GNUNET_STREAM_close (peer1.socket);
if (NULL != peer2.socket)
GNUNET_STREAM_close (peer2.socket);
if (NULL != peer2_listen_socket)
struct GNUNET_STREAM_Socket *socket,
const struct GNUNET_PeerIdentity *initiator)
{
+ if ((NULL == socket) || (NULL == initiator))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Binding error\n");
+ if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ GNUNET_SCHEDULER_cancel (abort_task);
+ abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
+ return GNUNET_OK;
+ }
GNUNET_assert (NULL != socket);
GNUNET_assert (socket != peer1.socket);