diff options
Diffstat (limited to 'src/mesh/mesh_api_new.c')
-rw-r--r-- | src/mesh/mesh_api_new.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c index 80228c80a..38efd8eb3 100644 --- a/src/mesh/mesh_api_new.c +++ b/src/mesh/mesh_api_new.c | |||
@@ -773,7 +773,7 @@ process_peer_event (struct GNUNET_MESH_Handle *h, | |||
773 | GNUNET_PEER_Id id; | 773 | GNUNET_PEER_Id id; |
774 | uint16_t size; | 774 | uint16_t size; |
775 | 775 | ||
776 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "mesh: processig peer event\n"); | 776 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: processig peer event\n"); |
777 | size = ntohs (msg->header.size); | 777 | size = ntohs (msg->header.size); |
778 | if (size != sizeof (struct GNUNET_MESH_PeerControl)) | 778 | if (size != sizeof (struct GNUNET_MESH_PeerControl)) |
779 | { | 779 | { |
@@ -789,9 +789,9 @@ process_peer_event (struct GNUNET_MESH_Handle *h, | |||
789 | id = GNUNET_PEER_search (&msg->peer); | 789 | id = GNUNET_PEER_search (&msg->peer); |
790 | if ((p = retrieve_peer (t, id)) == NULL) | 790 | if ((p = retrieve_peer (t, id)) == NULL) |
791 | p = add_peer_to_tunnel (t, &msg->peer); | 791 | p = add_peer_to_tunnel (t, &msg->peer); |
792 | if (GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_ADD == ntohs(msg->header.type)) | 792 | if (GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_ADD == ntohs (msg->header.type)) |
793 | { | 793 | { |
794 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "mesh: adding peer\n"); | 794 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: adding peer\n"); |
795 | if (NULL != t->connect_handler) | 795 | if (NULL != t->connect_handler) |
796 | { | 796 | { |
797 | atsi.type = 0; | 797 | atsi.type = 0; |
@@ -802,7 +802,7 @@ process_peer_event (struct GNUNET_MESH_Handle *h, | |||
802 | } | 802 | } |
803 | else | 803 | else |
804 | { | 804 | { |
805 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "mesh: removing peer\n"); | 805 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: removing peer\n"); |
806 | if (NULL != t->disconnect_handler && p->connected) | 806 | if (NULL != t->disconnect_handler && p->connected) |
807 | { | 807 | { |
808 | t->disconnect_handler (t->cls, &msg->peer); | 808 | t->disconnect_handler (t->cls, &msg->peer); |
@@ -810,7 +810,7 @@ process_peer_event (struct GNUNET_MESH_Handle *h, | |||
810 | remove_peer_from_tunnel (p); | 810 | remove_peer_from_tunnel (p); |
811 | GNUNET_free (p); | 811 | GNUNET_free (p); |
812 | } | 812 | } |
813 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "mesh: processing peer event END\n"); | 813 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: processing peer event END\n"); |
814 | } | 814 | } |
815 | 815 | ||
816 | 816 | ||
@@ -1165,12 +1165,13 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1165 | apps = (GNUNET_MESH_ApplicationType *) &msg[1]; | 1165 | apps = (GNUNET_MESH_ApplicationType *) &msg[1]; |
1166 | for (napps = 0; napps < h->n_applications; napps++) | 1166 | for (napps = 0; napps < h->n_applications; napps++) |
1167 | { | 1167 | { |
1168 | apps[napps] = htonl(h->applications[napps]); | 1168 | apps[napps] = htonl (h->applications[napps]); |
1169 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "mesh: app %u\n", h->applications[napps]); | 1169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: app %u\n", |
1170 | h->applications[napps]); | ||
1170 | } | 1171 | } |
1171 | types = (uint16_t *) &apps[napps]; | 1172 | types = (uint16_t *) & apps[napps]; |
1172 | for (ntypes = 0; ntypes < h->n_handlers; ntypes++) | 1173 | for (ntypes = 0; ntypes < h->n_handlers; ntypes++) |
1173 | types[ntypes] = htons(h->message_handlers[ntypes].type); | 1174 | types[ntypes] = htons (h->message_handlers[ntypes].type); |
1174 | msg->applications = htons (napps); | 1175 | msg->applications = htons (napps); |
1175 | msg->types = htons (ntypes); | 1176 | msg->types = htons (ntypes); |
1176 | #if DEBUG | 1177 | #if DEBUG |