diff options
author | marshall <stmr@umich.edu> | 2023-08-24 10:45:11 -0400 |
---|---|---|
committer | marshall <stmr@umich.edu> | 2023-08-24 10:45:11 -0400 |
commit | 1cb8c13c45deafa607b5f4800848cc23df31c595 (patch) | |
tree | 485f968da37654c89db62cbeb662ce01721434ae /src/transport | |
parent | 227bceda73093c37c1a0ab8e340be775b830d40f (diff) | |
download | gnunet-1cb8c13c45deafa607b5f4800848cc23df31c595.tar.gz gnunet-1cb8c13c45deafa607b5f4800848cc23df31c595.zip |
quic: fix mq_send
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-communicator-quic.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/transport/gnunet-communicator-quic.c b/src/transport/gnunet-communicator-quic.c index 7c89b10b6..3831dc214 100644 --- a/src/transport/gnunet-communicator-quic.c +++ b/src/transport/gnunet-communicator-quic.c | |||
@@ -240,6 +240,8 @@ recv_from_streams (struct PeerAddress *peer) | |||
240 | &fin); | 240 | &fin); |
241 | if (recv_len < 0) | 241 | if (recv_len < 0) |
242 | { | 242 | { |
243 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
244 | "error while receiving data from stream %" PRIu64 "\n", s); | ||
243 | break; | 245 | break; |
244 | } | 246 | } |
245 | /** | 247 | /** |
@@ -255,7 +257,7 @@ recv_from_streams (struct PeerAddress *peer) | |||
255 | return; | 257 | return; |
256 | } | 258 | } |
257 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 259 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
258 | "receiving peer identity\n"); | 260 | "received peer identity\n"); |
259 | struct GNUNET_PeerIdentity *pid = (struct | 261 | struct GNUNET_PeerIdentity *pid = (struct |
260 | GNUNET_PeerIdentity *) stream_buf; | 262 | GNUNET_PeerIdentity *) stream_buf; |
261 | peer->target = *pid; | 263 | peer->target = *pid; |
@@ -272,7 +274,8 @@ recv_from_streams (struct PeerAddress *peer) | |||
272 | if (ntohs (hdr->size) > recv_len) | 274 | if (ntohs (hdr->size) > recv_len) |
273 | { | 275 | { |
274 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 276 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
275 | "message size stated is greater than length of rcvd data!\n"); | 277 | "message size stated (%d) is greater than length of rcvd data (%zd)!\n", |
278 | ntohs (hdr->size), recv_len); | ||
276 | return; | 279 | return; |
277 | } | 280 | } |
278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "passing %zd bytes to core\n", | 281 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "passing %zd bytes to core\n", |
@@ -531,9 +534,9 @@ mq_send_d (struct GNUNET_MQ_Handle *mq, | |||
531 | { | 534 | { |
532 | struct PeerAddress *peer = impl_state; | 535 | struct PeerAddress *peer = impl_state; |
533 | uint16_t msize = ntohs (msg->size); | 536 | uint16_t msize = ntohs (msg->size); |
534 | struct quic_conn *q_conn = peer->conn; | 537 | ssize_t send_len; |
535 | 538 | ||
536 | if (NULL == q_conn->conn) | 539 | if (NULL == peer->conn->conn) |
537 | { | 540 | { |
538 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 541 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
539 | "peer never established quic connection\n"); | 542 | "peer never established quic connection\n"); |
@@ -558,20 +561,18 @@ mq_send_d (struct GNUNET_MQ_Handle *mq, | |||
558 | } | 561 | } |
559 | reschedule_peer_timeout (peer); | 562 | reschedule_peer_timeout (peer); |
560 | 563 | ||
561 | // quiche_conn_stream_send (peer->conn->conn, s, (uint8_t *) resp, | 564 | send_len = quiche_conn_stream_send (peer->conn->conn, 4, (uint8_t *) msg, |
562 | // 5, true); | 565 | msize, false); |
563 | // if (-1 == GNUNET_NETWORK_socket_sendto (udp_sock, | 566 | if (send_len != msize) |
564 | // dgram, | 567 | { |
565 | // sizeof(dgram), | 568 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
566 | // peer->address, | 569 | "tried to send message and quiche returned %zd", send_len); |
567 | // peer->address_len)) | 570 | return; |
568 | // GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); | 571 | } |
569 | // GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 572 | flush_egress (peer->conn); |
570 | // "Sending UDPBox with payload size %u, %u acks left\n", | 573 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
571 | // msize, | 574 | "sent a message of %zd bytes\n", send_len); |
572 | // peer->acks_available); | 575 | GNUNET_MQ_impl_send_continue (mq); |
573 | // GNUNET_MQ_impl_send_continue (mq); | ||
574 | // return; | ||
575 | } | 576 | } |
576 | 577 | ||
577 | 578 | ||
@@ -1420,7 +1421,7 @@ sock_read (void *cls) | |||
1420 | send_len = quiche_conn_stream_send (peer->conn->conn, STREAMID_BI, | 1421 | send_len = quiche_conn_stream_send (peer->conn->conn, STREAMID_BI, |
1421 | (const uint8_t *) &my_identity, | 1422 | (const uint8_t *) &my_identity, |
1422 | sizeof(my_identity), | 1423 | sizeof(my_identity), |
1423 | true); | 1424 | false); |
1424 | if (0 > send_len) | 1425 | if (0 > send_len) |
1425 | { | 1426 | { |
1426 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1427 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -1615,9 +1616,11 @@ run (void *cls, | |||
1615 | quiche_config_set_max_send_udp_payload_size (config, MAX_DATAGRAM_SIZE); | 1616 | quiche_config_set_max_send_udp_payload_size (config, MAX_DATAGRAM_SIZE); |
1616 | quiche_config_set_initial_max_data (config, 10000000); | 1617 | quiche_config_set_initial_max_data (config, 10000000); |
1617 | quiche_config_set_initial_max_stream_data_bidi_local (config, 1000000); | 1618 | quiche_config_set_initial_max_stream_data_bidi_local (config, 1000000); |
1619 | quiche_config_set_initial_max_stream_data_bidi_remote (config, 1000000); | ||
1618 | quiche_config_set_initial_max_stream_data_uni (config, 1000000); | 1620 | quiche_config_set_initial_max_stream_data_uni (config, 1000000); |
1619 | quiche_config_set_initial_max_streams_bidi (config, 100); | 1621 | quiche_config_set_initial_max_streams_bidi (config, 100); |
1620 | quiche_config_set_initial_max_streams_uni (config, 100); | 1622 | quiche_config_set_initial_max_streams_uni (config, 100); |
1623 | quiche_config_set_cc_algorithm (config, QUICHE_CC_RENO); | ||
1621 | quiche_config_set_disable_active_migration (config, true); | 1624 | quiche_config_set_disable_active_migration (config, true); |
1622 | addr_map = GNUNET_CONTAINER_multihashmap_create (2, GNUNET_NO); | 1625 | addr_map = GNUNET_CONTAINER_multihashmap_create (2, GNUNET_NO); |
1623 | /** | 1626 | /** |