aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-06-20 18:09:06 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-06-20 18:09:06 +0200
commit90302a3018c017b4a5b60d7c8f04f8924117c979 (patch)
tree7aae25ad0a44359a775ddef3633ffce9daf6e1fd /src
parent9d1854932cfdf962b30cf98a387c9ee23b3b6a07 (diff)
downloadgnunet-90302a3018c017b4a5b60d7c8f04f8924117c979.tar.gz
gnunet-90302a3018c017b4a5b60d7c8f04f8924117c979.zip
set: remove workaround to test if a set bug and not cadet was at fault
Diffstat (limited to 'src')
-rw-r--r--src/set/gnunet-service-set_union.c50
1 files changed, 13 insertions, 37 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index 077b899f6..ca1049148 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -1448,22 +1448,10 @@ maybe_finish (struct Operation *op)
1448 num_demanded); 1448 num_demanded);
1449 if (0 == num_demanded) 1449 if (0 == num_demanded)
1450 { 1450 {
1451 struct GNUNET_MQ_Envelope *ev;
1452
1453 op->state->phase = PHASE_DONE; 1451 op->state->phase = PHASE_DONE;
1454 /* FIXME: temporary hack, send message twice and add notification to second message, 1452 send_client_done (op);
1455 * so we can be pretty sure that the other party gets at least one of these 1453 _GSS_operation_destroy (op,
1456 * (since tunnel end handler is currently broken). 1454 GNUNET_YES);
1457 */
1458 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
1459 GNUNET_MQ_send (op->mq,
1460 ev);
1461 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
1462 GNUNET_MQ_notify_sent (ev,
1463 &send_client_done,
1464 op);
1465 GNUNET_MQ_send (op->mq,
1466 ev);
1467 } 1455 }
1468 } 1456 }
1469} 1457}
@@ -1881,32 +1869,18 @@ handle_union_p2p_full_done (void *cls,
1881 GNUNET_MQ_send (op->mq, 1869 GNUNET_MQ_send (op->mq,
1882 ev); 1870 ev);
1883 op->state->phase = PHASE_DONE; 1871 op->state->phase = PHASE_DONE;
1884 /* we now wait until the other peer sends us the OVER message*/ 1872 /* we now wait until the other peer disconnects */
1885 } 1873 }
1886 break; 1874 break;
1887 case PHASE_FULL_SENDING: 1875 case PHASE_FULL_SENDING:
1888 { 1876 {
1889 struct GNUNET_MQ_Envelope *ev;
1890
1891 LOG (GNUNET_ERROR_TYPE_DEBUG, 1877 LOG (GNUNET_ERROR_TYPE_DEBUG,
1892 "got FULL DONE, finishing\n"); 1878 "got FULL DONE, finishing\n");
1893 /* We sent the full set, and got the response for that. We're done. */ 1879 /* We sent the full set, and got the response for that. We're done. */
1894 op->state->phase = PHASE_DONE; 1880 op->state->phase = PHASE_DONE;
1895 GNUNET_CADET_receive_done (op->channel); 1881 send_client_done (op);
1896 /* FIXME: temporary hack, send message twice and add notification to second message, 1882 _GSS_operation_destroy (op,
1897 * so we can be pretty sure that the other party gets at least one of these 1883 GNUNET_YES);
1898 * (since tunnel end handler is currently broken).
1899 */
1900 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
1901 GNUNET_MQ_send (op->mq,
1902 ev);
1903 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_OVER);
1904 GNUNET_MQ_notify_sent (ev,
1905 &send_client_done,
1906 op);
1907 GNUNET_MQ_send (op->mq,
1908 ev);
1909 return;
1910 } 1884 }
1911 break; 1885 break;
1912 default: 1886 default:
@@ -2143,6 +2117,7 @@ handle_union_p2p_done (void *cls,
2143 fail_union_operation (op); 2117 fail_union_operation (op);
2144 return; 2118 return;
2145 } 2119 }
2120
2146 switch (op->state->phase) 2121 switch (op->state->phase)
2147 { 2122 {
2148 case PHASE_INVENTORY_PASSIVE: 2123 case PHASE_INVENTORY_PASSIVE:
@@ -2160,9 +2135,8 @@ handle_union_p2p_done (void *cls,
2160 * all our demands are satisfied, so that the active 2135 * all our demands are satisfied, so that the active
2161 * peer can quit if we gave him everything. 2136 * peer can quit if we gave him everything.
2162 */ 2137 */
2163 GNUNET_CADET_receive_done (op->channel);
2164 maybe_finish (op); 2138 maybe_finish (op);
2165 return; 2139 break;
2166 case PHASE_INVENTORY_ACTIVE: 2140 case PHASE_INVENTORY_ACTIVE:
2167 LOG (GNUNET_ERROR_TYPE_DEBUG, 2141 LOG (GNUNET_ERROR_TYPE_DEBUG,
2168 "got DONE (as active partner), waiting to finish\n"); 2142 "got DONE (as active partner), waiting to finish\n");
@@ -2174,14 +2148,15 @@ handle_union_p2p_done (void *cls,
2174 * to the other peer once our demands are met. 2148 * to the other peer once our demands are met.
2175 */ 2149 */
2176 op->state->phase = PHASE_FINISH_CLOSING; 2150 op->state->phase = PHASE_FINISH_CLOSING;
2177 GNUNET_CADET_receive_done (op->channel);
2178 maybe_finish (op); 2151 maybe_finish (op);
2179 return; 2152 break;
2180 default: 2153 default:
2181 GNUNET_break_op (0); 2154 GNUNET_break_op (0);
2182 fail_union_operation (op); 2155 fail_union_operation (op);
2183 return; 2156 return;
2184 } 2157 }
2158 GNUNET_CADET_receive_done (op->channel);
2159
2185} 2160}
2186 2161
2187/** 2162/**
@@ -2425,6 +2400,7 @@ union_copy_state (struct SetState *state)
2425static void 2400static void
2426union_channel_death (struct Operation *op) 2401union_channel_death (struct Operation *op)
2427{ 2402{
2403 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "channel died, sending result to client\n");
2428 send_client_done (op); 2404 send_client_done (op);
2429 _GSS_operation_destroy (op, 2405 _GSS_operation_destroy (op,
2430 GNUNET_YES); 2406 GNUNET_YES);