diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh_peer.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 4d183bbd6..8f13d0bb1 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -858,9 +858,7 @@ queue_send (void *cls, size_t size, void *buf) | |||
858 | case GNUNET_MESSAGE_TYPE_MESH_KX: | 858 | case GNUNET_MESSAGE_TYPE_MESH_KX: |
859 | case GNUNET_MESSAGE_TYPE_MESH_ACK: | 859 | case GNUNET_MESSAGE_TYPE_MESH_ACK: |
860 | case GNUNET_MESSAGE_TYPE_MESH_POLL: | 860 | case GNUNET_MESSAGE_TYPE_MESH_POLL: |
861 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 861 | LOG (GNUNET_ERROR_TYPE_DEBUG, "* raw: %s\n", GM_m2s (queue->type)); |
862 | "* raw: %s\n", | ||
863 | GM_m2s (queue->type)); | ||
864 | data_size = send_core_data_raw (queue->cls, size, buf); | 862 | data_size = send_core_data_raw (queue->cls, size, buf); |
865 | break; | 863 | break; |
866 | case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE: | 864 | case GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE: |
@@ -911,14 +909,13 @@ queue_send (void *cls, size_t size, void *buf) | |||
911 | if (NULL == peer->core_transmit) | 909 | if (NULL == peer->core_transmit) |
912 | { | 910 | { |
913 | peer->core_transmit = | 911 | peer->core_transmit = |
914 | GNUNET_CORE_notify_transmit_ready(core_handle, | 912 | GNUNET_CORE_notify_transmit_ready (core_handle, |
915 | 0, | 913 | 0, 0, |
916 | 0, | 914 | GNUNET_TIME_UNIT_FOREVER_REL, |
917 | GNUNET_TIME_UNIT_FOREVER_REL, | 915 | dst_id, |
918 | dst_id, | 916 | queue->size, |
919 | queue->size, | 917 | &queue_send, |
920 | &queue_send, | 918 | peer); |
921 | peer); | ||
922 | queue->start_waiting = GNUNET_TIME_absolute_get (); | 919 | queue->start_waiting = GNUNET_TIME_absolute_get (); |
923 | } | 920 | } |
924 | else | 921 | else |
@@ -956,7 +953,6 @@ GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls) | |||
956 | struct MeshPeer *peer; | 953 | struct MeshPeer *peer; |
957 | 954 | ||
958 | peer = queue->peer; | 955 | peer = queue->peer; |
959 | GNUNET_assert (NULL != queue->c); | ||
960 | 956 | ||
961 | if (GNUNET_YES == clear_cls) | 957 | if (GNUNET_YES == clear_cls) |
962 | { | 958 | { |
@@ -1013,7 +1009,7 @@ GMP_queue_destroy (struct MeshPeerQueue *queue, int clear_cls) | |||
1013 | * build the message to be sent if not already prebuilt. | 1009 | * build the message to be sent if not already prebuilt. |
1014 | * @param type Type of the message, 0 for a raw message. | 1010 | * @param type Type of the message, 0 for a raw message. |
1015 | * @param size Size of the message. | 1011 | * @param size Size of the message. |
1016 | * @param c Connection this message belongs to (cannot be NULL). | 1012 | * @param c Connection this message belongs to (can be NULL). |
1017 | * @param fwd Is this a message going root->dest? (FWD ACK are NOT FWD!) | 1013 | * @param fwd Is this a message going root->dest? (FWD ACK are NOT FWD!) |
1018 | * @param cont Continuation to be called once CORE has taken the message. | 1014 | * @param cont Continuation to be called once CORE has taken the message. |
1019 | * @param cont_cls Closure for @c cont. | 1015 | * @param cont_cls Closure for @c cont. |
@@ -1034,7 +1030,6 @@ GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, size_t size, | |||
1034 | "queue add %s %s towards %s (size %u) on c %p (%s)\n", | 1030 | "queue add %s %s towards %s (size %u) on c %p (%s)\n", |
1035 | GM_f2s (fwd), GM_m2s (type), GMP_2s(peer), | 1031 | GM_f2s (fwd), GM_m2s (type), GMP_2s(peer), |
1036 | size, c, GMC_2s (c)); | 1032 | size, c, GMC_2s (c)); |
1037 | GNUNET_assert (NULL != c); | ||
1038 | 1033 | ||
1039 | if (NULL == peer->connections) | 1034 | if (NULL == peer->connections) |
1040 | { | 1035 | { |
@@ -1055,7 +1050,7 @@ GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, size_t size, | |||
1055 | 1050 | ||
1056 | LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); | 1051 | LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); |
1057 | 1052 | ||
1058 | call_core = GMC_is_sendable (c, fwd); | 1053 | call_core = NULL == c ? GNUNET_YES : GMC_is_sendable (c, fwd); |
1059 | queue = GNUNET_malloc (sizeof (struct MeshPeerQueue)); | 1054 | queue = GNUNET_malloc (sizeof (struct MeshPeerQueue)); |
1060 | queue->cls = cls; | 1055 | queue->cls = cls; |
1061 | queue->type = type; | 1056 | queue->type = type; |