h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
/* count handlers and apps, calculate size */
- for (h->n_applications = 0; stypes[h->n_applications]; h->n_applications++) ;
- for (h->n_handlers = 0; handlers[h->n_handlers].type; h->n_handlers++) ;
+ for (h->n_applications = 0;
+ stypes && stypes[h->n_applications];
+ h->n_applications++) ;
+ for (h->n_handlers = 0;
+ handlers && handlers[h->n_handlers].type;
+ h->n_handlers++) ;
send_connect (h);
LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect() END\n");
return h;
send_packet (h, &msg.header, NULL);
}
+
/**
* Request that a peer should be added to the tunnel. The existing
* connect handler will be called ONCE with either success or failure.
* This function should NOT be called again with the same peer before the
* connect handler is called.
+ * FIXME: I think the above documentation is false. I think it should
+ * read: "The connect handler will be called once the peer was actually
+ * successfully added to the multicast group. This function should
+ * not be called twice for the same peer (unless, of course,
+ * the peer was removed using GNUNET_MESH_peer_Request_connect_del in
+ * the meantime).
*
* @param tunnel handle to existing tunnel
* @param peer peer to add
msg.tunnel_id = htonl (tunnel->tid);
msg.peer = *peer;
send_packet (tunnel->mesh, &msg.header, tunnel);
-
- return;
}