diff options
author | Gabor X Toth <*@tg-x.net> | 2015-09-27 21:04:34 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-09-27 21:04:34 +0000 |
commit | cab1b047ddcac497e14515fc11f097c4aac8ee27 (patch) | |
tree | 7f4e14a8c77d76bef07cb4bbf6b94adcce44d53c /src/psyc | |
parent | 51f530b98232f7a9947f29008d161ed0d8e23af4 (diff) | |
download | gnunet-cab1b047ddcac497e14515fc11f097c4aac8ee27.tar.gz gnunet-cab1b047ddcac497e14515fc11f097c4aac8ee27.zip |
multicast/psyc/social: message acks & scheduling
Diffstat (limited to 'src/psyc')
-rw-r--r-- | src/psyc/gnunet-service-psyc.c | 82 | ||||
-rw-r--r-- | src/psyc/test_psyc.c | 47 |
2 files changed, 72 insertions, 57 deletions
diff --git a/src/psyc/gnunet-service-psyc.c b/src/psyc/gnunet-service-psyc.c index ceb0ca95b..e710b41a5 100644 --- a/src/psyc/gnunet-service-psyc.c +++ b/src/psyc/gnunet-service-psyc.c | |||
@@ -107,17 +107,6 @@ struct TransmitMessage | |||
107 | */ | 107 | */ |
108 | uint16_t last_ptype; | 108 | uint16_t last_ptype; |
109 | 109 | ||
110 | /** | ||
111 | * @see enum MessageState | ||
112 | */ | ||
113 | uint8_t state; | ||
114 | |||
115 | /** | ||
116 | * Whether a message ACK has already been sent to the client. | ||
117 | * #GNUNET_YES or #GNUNET_NO | ||
118 | */ | ||
119 | uint8_t ack_sent; | ||
120 | |||
121 | /* Followed by message */ | 110 | /* Followed by message */ |
122 | }; | 111 | }; |
123 | 112 | ||
@@ -281,11 +270,6 @@ struct Channel | |||
281 | uint32_t tmit_mod_value_size; | 270 | uint32_t tmit_mod_value_size; |
282 | 271 | ||
283 | /** | 272 | /** |
284 | * @see enum MessageState | ||
285 | */ | ||
286 | uint8_t tmit_state; | ||
287 | |||
288 | /** | ||
289 | * Is this a channel master (#GNUNET_YES), or slave (#GNUNET_NO)? | 273 | * Is this a channel master (#GNUNET_YES), or slave (#GNUNET_NO)? |
290 | */ | 274 | */ |
291 | uint8_t is_master; | 275 | uint8_t is_master; |
@@ -438,6 +422,15 @@ static uint64_t | |||
438 | message_queue_drop (struct Channel *chn); | 422 | message_queue_drop (struct Channel *chn); |
439 | 423 | ||
440 | 424 | ||
425 | static void | ||
426 | schedule_transmit_message (void *cls, | ||
427 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
428 | { | ||
429 | struct Channel *chn = cls; | ||
430 | transmit_message (chn); | ||
431 | } | ||
432 | |||
433 | |||
441 | /** | 434 | /** |
442 | * Task run during shutdown. | 435 | * Task run during shutdown. |
443 | * | 436 | * |
@@ -1145,8 +1138,8 @@ fragment_queue_insert (struct Channel *chn, | |||
1145 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1138 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1146 | "%p Header of message %" PRIu64 " is NOT complete yet: " | 1139 | "%p Header of message %" PRIu64 " is NOT complete yet: " |
1147 | "%" PRIu64 " != %" PRIu64 "\n", | 1140 | "%" PRIu64 " != %" PRIu64 "\n", |
1148 | chn, GNUNET_ntohll (mmsg->message_id), frag_offset, | 1141 | chn, GNUNET_ntohll (mmsg->message_id), |
1149 | fragq->header_size); | 1142 | frag_offset, fragq->header_size); |
1150 | } | 1143 | } |
1151 | } | 1144 | } |
1152 | 1145 | ||
@@ -1159,8 +1152,8 @@ fragment_queue_insert (struct Channel *chn, | |||
1159 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1152 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1160 | "%p Message %" PRIu64 " is NOT complete yet: " | 1153 | "%p Message %" PRIu64 " is NOT complete yet: " |
1161 | "%" PRIu64 " != %" PRIu64 "\n", | 1154 | "%" PRIu64 " != %" PRIu64 "\n", |
1162 | chn, GNUNET_ntohll (mmsg->message_id), frag_offset, | 1155 | chn, GNUNET_ntohll (mmsg->message_id), |
1163 | fragq->size); | 1156 | frag_offset, fragq->size); |
1164 | break; | 1157 | break; |
1165 | 1158 | ||
1166 | case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_CANCEL: | 1159 | case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_CANCEL: |
@@ -1486,17 +1479,26 @@ mcast_recv_message (void *cls, const struct GNUNET_MULTICAST_MessageHeader *mmsg | |||
1486 | uint16_t size = ntohs (mmsg->header.size); | 1479 | uint16_t size = ntohs (mmsg->header.size); |
1487 | 1480 | ||
1488 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1481 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1489 | "%p Received multicast message of size %u.\n", | 1482 | "%p Received multicast message of size %u. " |
1490 | chn, size); | 1483 | "fragment_id=%" PRIu64 ", message_id=%" PRIu64 |
1484 | ", fragment_offset=%" PRIu64 ", flags=%" PRIu64 "\n", | ||
1485 | chn, size, | ||
1486 | GNUNET_ntohll (mmsg->fragment_id), | ||
1487 | GNUNET_ntohll (mmsg->message_id), | ||
1488 | GNUNET_ntohll (mmsg->fragment_offset), | ||
1489 | GNUNET_ntohll (mmsg->flags)); | ||
1491 | 1490 | ||
1492 | GNUNET_PSYCSTORE_fragment_store (store, &chn->pub_key, mmsg, 0, | 1491 | GNUNET_PSYCSTORE_fragment_store (store, &chn->pub_key, mmsg, 0, |
1493 | &store_recv_fragment_store_result, chn); | 1492 | &store_recv_fragment_store_result, chn); |
1494 | 1493 | ||
1495 | uint16_t first_ptype = 0, last_ptype = 0; | 1494 | uint16_t first_ptype = 0, last_ptype = 0; |
1496 | if (GNUNET_SYSERR | 1495 | int check = GNUNET_PSYC_receive_check_parts (size - sizeof (*mmsg), |
1497 | == GNUNET_PSYC_receive_check_parts (size - sizeof (*mmsg), | 1496 | (const char *) &mmsg[1], |
1498 | (const char *) &mmsg[1], | 1497 | &first_ptype, &last_ptype); |
1499 | &first_ptype, &last_ptype)) | 1498 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1499 | "%p Message check result %d, first part type %u, last part type %u\n", | ||
1500 | chn, check, first_ptype, last_ptype); | ||
1501 | if (GNUNET_SYSERR == check) | ||
1500 | { | 1502 | { |
1501 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1503 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1502 | "%p Dropping incoming multicast message with invalid parts.\n", | 1504 | "%p Dropping incoming multicast message with invalid parts.\n", |
@@ -1505,10 +1507,6 @@ mcast_recv_message (void *cls, const struct GNUNET_MULTICAST_MessageHeader *mmsg | |||
1505 | return; | 1507 | return; |
1506 | } | 1508 | } |
1507 | 1509 | ||
1508 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1509 | "Message parts: first: type %u, last: type %u\n", | ||
1510 | first_ptype, last_ptype); | ||
1511 | |||
1512 | fragment_queue_insert (chn, mmsg, first_ptype, last_ptype); | 1510 | fragment_queue_insert (chn, mmsg, first_ptype, last_ptype); |
1513 | message_queue_run (chn); | 1511 | message_queue_run (chn); |
1514 | } | 1512 | } |
@@ -1965,6 +1963,8 @@ transmit_notify (void *cls, size_t *data_size, void *data) | |||
1965 | { | 1963 | { |
1966 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1964 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1967 | "%p transmit_notify: nothing to send.\n", chn); | 1965 | "%p transmit_notify: nothing to send.\n", chn); |
1966 | if (NULL != tmit_msg && *data_size < tmit_msg->size) | ||
1967 | GNUNET_break (0); | ||
1968 | *data_size = 0; | 1968 | *data_size = 0; |
1969 | return GNUNET_NO; | 1969 | return GNUNET_NO; |
1970 | } | 1970 | } |
@@ -1975,9 +1975,13 @@ transmit_notify (void *cls, size_t *data_size, void *data) | |||
1975 | *data_size = tmit_msg->size; | 1975 | *data_size = tmit_msg->size; |
1976 | memcpy (data, &tmit_msg[1], *data_size); | 1976 | memcpy (data, &tmit_msg[1], *data_size); |
1977 | 1977 | ||
1978 | int ret = (MSG_STATE_END < chn->tmit_state) ? GNUNET_NO : GNUNET_YES; | 1978 | int ret |
1979 | = (tmit_msg->last_ptype < GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_END) | ||
1980 | ? GNUNET_NO | ||
1981 | : GNUNET_YES; | ||
1979 | 1982 | ||
1980 | if (NULL != tmit_msg->client && GNUNET_NO == tmit_msg->ack_sent) | 1983 | /* FIXME: handle disconnecting clients */ |
1984 | if (NULL != tmit_msg->client) | ||
1981 | send_message_ack (chn, tmit_msg->client); | 1985 | send_message_ack (chn, tmit_msg->client); |
1982 | 1986 | ||
1983 | GNUNET_CONTAINER_DLL_remove (chn->tmit_head, chn->tmit_tail, tmit_msg); | 1987 | GNUNET_CONTAINER_DLL_remove (chn->tmit_head, chn->tmit_tail, tmit_msg); |
@@ -1985,7 +1989,7 @@ transmit_notify (void *cls, size_t *data_size, void *data) | |||
1985 | 1989 | ||
1986 | if (NULL != chn->tmit_head) | 1990 | if (NULL != chn->tmit_head) |
1987 | { | 1991 | { |
1988 | transmit_message (chn); | 1992 | GNUNET_SCHEDULER_add_now (schedule_transmit_message, chn); |
1989 | } | 1993 | } |
1990 | else if (GNUNET_YES == chn->is_disconnected | 1994 | else if (GNUNET_YES == chn->is_disconnected |
1991 | && tmit_msg->last_ptype < GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_END) | 1995 | && tmit_msg->last_ptype < GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_END) |
@@ -2037,10 +2041,12 @@ slave_transmit_notify (void *cls, size_t *data_size, void *data) | |||
2037 | static void | 2041 | static void |
2038 | master_transmit_message (struct Master *mst) | 2042 | master_transmit_message (struct Master *mst) |
2039 | { | 2043 | { |
2044 | if (NULL == mst->chn.tmit_head) | ||
2045 | return; | ||
2040 | if (NULL == mst->tmit_handle) | 2046 | if (NULL == mst->tmit_handle) |
2041 | { | 2047 | { |
2042 | mst->tmit_handle | 2048 | mst->tmit_handle |
2043 | = GNUNET_MULTICAST_origin_to_all (mst->origin, mst->max_message_id, | 2049 | = GNUNET_MULTICAST_origin_to_all (mst->origin, mst->chn.tmit_head->id, |
2044 | mst->max_group_generation, | 2050 | mst->max_group_generation, |
2045 | master_transmit_notify, mst); | 2051 | master_transmit_notify, mst); |
2046 | } | 2052 | } |
@@ -2057,10 +2063,12 @@ master_transmit_message (struct Master *mst) | |||
2057 | static void | 2063 | static void |
2058 | slave_transmit_message (struct Slave *slv) | 2064 | slave_transmit_message (struct Slave *slv) |
2059 | { | 2065 | { |
2066 | if (NULL == slv->chn.tmit_head) | ||
2067 | return; | ||
2060 | if (NULL == slv->tmit_handle) | 2068 | if (NULL == slv->tmit_handle) |
2061 | { | 2069 | { |
2062 | slv->tmit_handle | 2070 | slv->tmit_handle |
2063 | = GNUNET_MULTICAST_member_to_origin (slv->member, slv->max_request_id, | 2071 | = GNUNET_MULTICAST_member_to_origin (slv->member, slv->chn.tmit_head->id, |
2064 | slave_transmit_notify, slv); | 2072 | slave_transmit_notify, slv); |
2065 | } | 2073 | } |
2066 | else | 2074 | else |
@@ -2090,6 +2098,9 @@ master_queue_message (struct Master *mst, struct TransmitMessage *tmit_msg) | |||
2090 | if (GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD == tmit_msg->first_ptype) | 2098 | if (GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD == tmit_msg->first_ptype) |
2091 | { | 2099 | { |
2092 | tmit_msg->id = ++mst->max_message_id; | 2100 | tmit_msg->id = ++mst->max_message_id; |
2101 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
2102 | "%p master_queue_message: message_id=%" PRIu64 "\n", | ||
2103 | mst, tmit_msg->id); | ||
2093 | struct GNUNET_PSYC_MessageMethod *pmeth | 2104 | struct GNUNET_PSYC_MessageMethod *pmeth |
2094 | = (struct GNUNET_PSYC_MessageMethod *) &tmit_msg[1]; | 2105 | = (struct GNUNET_PSYC_MessageMethod *) &tmit_msg[1]; |
2095 | 2106 | ||
@@ -2159,7 +2170,6 @@ queue_message (struct Channel *chn, | |||
2159 | memcpy (&tmit_msg[1], data, data_size); | 2170 | memcpy (&tmit_msg[1], data, data_size); |
2160 | tmit_msg->client = client; | 2171 | tmit_msg->client = client; |
2161 | tmit_msg->size = data_size; | 2172 | tmit_msg->size = data_size; |
2162 | tmit_msg->state = chn->tmit_state; | ||
2163 | tmit_msg->first_ptype = first_ptype; | 2173 | tmit_msg->first_ptype = first_ptype; |
2164 | tmit_msg->last_ptype = last_ptype; | 2174 | tmit_msg->last_ptype = last_ptype; |
2165 | 2175 | ||
diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c index e2e6cfc87..1ce9074d5 100644 --- a/src/psyc/test_psyc.c +++ b/src/psyc/test_psyc.c | |||
@@ -225,7 +225,8 @@ master_message_part_cb (void *cls, | |||
225 | if (NULL == msg) | 225 | if (NULL == msg) |
226 | { | 226 | { |
227 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 227 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
228 | "Error while receiving message %" PRIu64 "\n", message_id); | 228 | "Test #%d: Error while master is receiving part of message #%" PRIu64 ".\n", |
229 | test, message_id); | ||
229 | return; | 230 | return; |
230 | } | 231 | } |
231 | 232 | ||
@@ -243,7 +244,8 @@ master_message_part_cb (void *cls, | |||
243 | if (GNUNET_PSYC_MESSAGE_REQUEST != flags) | 244 | if (GNUNET_PSYC_MESSAGE_REQUEST != flags) |
244 | { | 245 | { |
245 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 246 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
246 | "Unexpected request flags: %x" PRIu32 "\n", flags); | 247 | "Test #%d: Unexpected request flags: %x" PRIu32 "\n", |
248 | test, flags); | ||
247 | GNUNET_assert (0); | 249 | GNUNET_assert (0); |
248 | return; | 250 | return; |
249 | } | 251 | } |
@@ -297,7 +299,8 @@ slave_message_part_cb (void *cls, | |||
297 | if (NULL == msg) | 299 | if (NULL == msg) |
298 | { | 300 | { |
299 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 301 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
300 | "Error while receiving message " PRIu64 "\n", message_id); | 302 | "Test #%d: Error while slave is receiving part of message #%" PRIu64 ".\n", |
303 | test, message_id); | ||
301 | return; | 304 | return; |
302 | } | 305 | } |
303 | 306 | ||
@@ -322,7 +325,7 @@ slave_message_part_cb (void *cls, | |||
322 | { | 325 | { |
323 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 326 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
324 | "Test #%d: Unexpected flags for historic message: %x" PRIu32 "\n", | 327 | "Test #%d: Unexpected flags for historic message: %x" PRIu32 "\n", |
325 | flags); | 328 | test, flags); |
326 | GNUNET_assert (0); | 329 | GNUNET_assert (0); |
327 | return; | 330 | return; |
328 | } | 331 | } |
@@ -575,9 +578,9 @@ tmit_notify_data (void *cls, uint16_t *data_size, void *data) | |||
575 | 578 | ||
576 | uint16_t size = strlen (tmit->data[tmit->n]); | 579 | uint16_t size = strlen (tmit->data[tmit->n]); |
577 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 580 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
578 | "Transmit notify data: %u bytes available, " | 581 | "Test #%d: Transmit notify data: %u bytes available, " |
579 | "processing fragment %u/%u (size %u).\n", | 582 | "processing fragment %u/%u (size %u).\n", |
580 | *data_size, tmit->n + 1, tmit->data_count, size); | 583 | test, *data_size, tmit->n + 1, tmit->data_count, size); |
581 | if (*data_size < size) | 584 | if (*data_size < size) |
582 | { | 585 | { |
583 | *data_size = 0; | 586 | *data_size = 0; |
@@ -587,7 +590,8 @@ tmit_notify_data (void *cls, uint16_t *data_size, void *data) | |||
587 | 590 | ||
588 | if (GNUNET_YES != tmit->paused && 0 < tmit->data_delay[tmit->n]) | 591 | if (GNUNET_YES != tmit->paused && 0 < tmit->data_delay[tmit->n]) |
589 | { | 592 | { |
590 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission paused.\n"); | 593 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
594 | "Test #%d: Transmission paused.\n", test); | ||
591 | tmit->paused = GNUNET_YES; | 595 | tmit->paused = GNUNET_YES; |
592 | GNUNET_SCHEDULER_add_delayed ( | 596 | GNUNET_SCHEDULER_add_delayed ( |
593 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 597 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
@@ -611,9 +615,9 @@ tmit_notify_mod (void *cls, uint16_t *data_size, void *data, uint8_t *oper, | |||
611 | { | 615 | { |
612 | struct TransmitClosure *tmit = cls; | 616 | struct TransmitClosure *tmit = cls; |
613 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 617 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
614 | "Transmit notify modifier: %lu bytes available, " | 618 | "Test #%d: Transmit notify modifier: %lu bytes available, " |
615 | "%u modifiers left to process.\n", | 619 | "%u modifiers left to process.\n", |
616 | *data_size, GNUNET_ENV_environment_get_count (tmit->env)); | 620 | test, *data_size, GNUNET_ENV_environment_get_count (tmit->env)); |
617 | 621 | ||
618 | uint16_t name_size = 0; | 622 | uint16_t name_size = 0; |
619 | size_t value_size = 0; | 623 | size_t value_size = 0; |
@@ -688,9 +692,9 @@ slave_join (); | |||
688 | void | 692 | void |
689 | slave_transmit () | 693 | slave_transmit () |
690 | { | 694 | { |
691 | |||
692 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Slave sending request to master.\n"); | ||
693 | test = TEST_SLAVE_TRANSMIT; | 695 | test = TEST_SLAVE_TRANSMIT; |
696 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
697 | "Test #%d: Slave sending request to master.\n", test); | ||
694 | 698 | ||
695 | tmit = GNUNET_new (struct TransmitClosure); | 699 | tmit = GNUNET_new (struct TransmitClosure); |
696 | tmit->env = GNUNET_ENV_environment_create (); | 700 | tmit->env = GNUNET_ENV_environment_create (); |
@@ -772,7 +776,7 @@ join_decision_cb (void *cls, | |||
772 | const struct GNUNET_PSYC_Message *join_msg) | 776 | const struct GNUNET_PSYC_Message *join_msg) |
773 | { | 777 | { |
774 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 778 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
775 | "Slave got join decision: %d\n", is_admitted); | 779 | "Test #%d: Slave got join decision: %d\n", test, is_admitted); |
776 | 780 | ||
777 | switch (test) | 781 | switch (test) |
778 | { | 782 | { |
@@ -804,8 +808,8 @@ join_request_cb (void *cls, | |||
804 | struct GNUNET_HashCode slave_key_hash; | 808 | struct GNUNET_HashCode slave_key_hash; |
805 | GNUNET_CRYPTO_hash (slave_key, sizeof (*slave_key), &slave_key_hash); | 809 | GNUNET_CRYPTO_hash (slave_key, sizeof (*slave_key), &slave_key_hash); |
806 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 810 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
807 | "Got join request #%u from %s.\n", | 811 | "Test #%d: Got join request #%u from %s.\n", |
808 | join_req_count, GNUNET_h2s (&slave_key_hash)); | 812 | test, join_req_count, GNUNET_h2s (&slave_key_hash)); |
809 | 813 | ||
810 | /* Reject first request */ | 814 | /* Reject first request */ |
811 | int is_admitted = (0 < join_req_count++) ? GNUNET_YES : GNUNET_NO; | 815 | int is_admitted = (0 < join_req_count++) ? GNUNET_YES : GNUNET_NO; |
@@ -817,8 +821,8 @@ static void | |||
817 | slave_connect_cb (void *cls, int result, uint64_t max_message_id) | 821 | slave_connect_cb (void *cls, int result, uint64_t max_message_id) |
818 | { | 822 | { |
819 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 823 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
820 | "Slave connected: %d, max_message_id: %" PRIu64 "\n", | 824 | "Test #%d: Slave connected: %d, max_message_id: %" PRIu64 "\n", |
821 | result, max_message_id); | 825 | test, result, max_message_id); |
822 | GNUNET_assert (TEST_SLAVE_JOIN_REJECT == test || TEST_SLAVE_JOIN_ACCEPT == test); | 826 | GNUNET_assert (TEST_SLAVE_JOIN_REJECT == test || TEST_SLAVE_JOIN_ACCEPT == test); |
823 | GNUNET_assert (GNUNET_OK == result || GNUNET_NO == result); | 827 | GNUNET_assert (GNUNET_OK == result || GNUNET_NO == result); |
824 | } | 828 | } |
@@ -827,8 +831,8 @@ slave_connect_cb (void *cls, int result, uint64_t max_message_id) | |||
827 | static void | 831 | static void |
828 | slave_join (int t) | 832 | slave_join (int t) |
829 | { | 833 | { |
830 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Joining slave.\n"); | ||
831 | test = t; | 834 | test = t; |
835 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test #%d: Joining slave.\n"); | ||
832 | 836 | ||
833 | struct GNUNET_PeerIdentity origin = this_peer; | 837 | struct GNUNET_PeerIdentity origin = this_peer; |
834 | struct GNUNET_ENV_Environment *env = GNUNET_ENV_environment_create (); | 838 | struct GNUNET_ENV_Environment *env = GNUNET_ENV_environment_create (); |
@@ -852,8 +856,9 @@ slave_join (int t) | |||
852 | void | 856 | void |
853 | master_transmit () | 857 | master_transmit () |
854 | { | 858 | { |
855 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Master sending message to all.\n"); | ||
856 | test = TEST_MASTER_TRANSMIT; | 859 | test = TEST_MASTER_TRANSMIT; |
860 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
861 | "Test #%d: Master sending message to all.\n", test); | ||
857 | end_count = 0; | 862 | end_count = 0; |
858 | 863 | ||
859 | uint32_t i, j; | 864 | uint32_t i, j; |
@@ -907,8 +912,8 @@ void | |||
907 | master_start_cb (void *cls, int result, uint64_t max_message_id) | 912 | master_start_cb (void *cls, int result, uint64_t max_message_id) |
908 | { | 913 | { |
909 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 914 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
910 | "Master started: %d, max_message_id: %" PRIu64 "\n", | 915 | "Test #%d: Master started: %d, max_message_id: %" PRIu64 "\n", |
911 | result, max_message_id); | 916 | test, result, max_message_id); |
912 | GNUNET_assert (TEST_MASTER_START == test); | 917 | GNUNET_assert (TEST_MASTER_START == test); |
913 | GNUNET_assert (GNUNET_OK == result || GNUNET_NO == result); | 918 | GNUNET_assert (GNUNET_OK == result || GNUNET_NO == result); |
914 | slave_join (TEST_SLAVE_JOIN_REJECT); | 919 | slave_join (TEST_SLAVE_JOIN_REJECT); |
@@ -918,8 +923,8 @@ master_start_cb (void *cls, int result, uint64_t max_message_id) | |||
918 | void | 923 | void |
919 | master_start () | 924 | master_start () |
920 | { | 925 | { |
921 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Starting master.\n"); | ||
922 | test = TEST_MASTER_START; | 926 | test = TEST_MASTER_START; |
927 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test #%d: Starting master.\n", test); | ||
923 | mst = GNUNET_PSYC_master_start (cfg, channel_key, GNUNET_PSYC_CHANNEL_PRIVATE, | 928 | mst = GNUNET_PSYC_master_start (cfg, channel_key, GNUNET_PSYC_CHANNEL_PRIVATE, |
924 | &master_start_cb, &join_request_cb, | 929 | &master_start_cb, &join_request_cb, |
925 | &master_message_cb, &master_message_part_cb, | 930 | &master_message_cb, &master_message_part_cb, |