aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2024-03-10 11:31:19 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2024-03-10 11:31:19 +0100
commitbedcdf2dbf63590dd128f3670763d3e9f2c749e5 (patch)
tree29edfccd7fdd9b59bf7c86a20e41d2bc3b449f1d
parent6d3268625275afd3b5796bcbf938f38d4f480ae1 (diff)
downloadgnunet-bedcdf2dbf63590dd128f3670763d3e9f2c749e5.tar.gz
gnunet-bedcdf2dbf63590dd128f3670763d3e9f2c749e5.zip
transport: add a couple of comments to TCP communicator/service
m---------contrib/handbook0
-rw-r--r--src/service/transport/gnunet-communicator-tcp.c12
-rw-r--r--src/service/transport/gnunet-service-transport.c6
3 files changed, 8 insertions, 10 deletions
diff --git a/contrib/handbook b/contrib/handbook
Subproject f88a389426a665df222486b0563e5a91e77a704 Subproject f9368db2bf8ce9eb6a9e951891142309c9c898d
diff --git a/src/service/transport/gnunet-communicator-tcp.c b/src/service/transport/gnunet-communicator-tcp.c
index b08b571d1..bb6c10166 100644
--- a/src/service/transport/gnunet-communicator-tcp.c
+++ b/src/service/transport/gnunet-communicator-tcp.c
@@ -1321,6 +1321,7 @@ rekey_monotime_cb (void *cls,
1321 GNUNET_break (0); 1321 GNUNET_break (0);
1322 GNUNET_PEERSTORE_iteration_stop (queue->rekey_monotime_get); 1322 GNUNET_PEERSTORE_iteration_stop (queue->rekey_monotime_get);
1323 queue->rekey_monotime_get = NULL; 1323 queue->rekey_monotime_get = NULL;
1324 // FIXME: Why should we try to gracefully finish here??
1324 queue_finish (queue); 1325 queue_finish (queue);
1325 return; 1326 return;
1326 } 1327 }
@@ -1402,6 +1403,7 @@ do_rekey (struct Queue *queue, const struct TCPRekey *rekey)
1402 &queue->target.public_key)) 1403 &queue->target.public_key))
1403 { 1404 {
1404 GNUNET_break (0); 1405 GNUNET_break (0);
1406 // FIXME Why should we try to gracefully finish here?
1405 queue_finish (queue); 1407 queue_finish (queue);
1406 return; 1408 return;
1407 } 1409 }
@@ -1483,6 +1485,7 @@ handshake_ack_monotime_cb (void *cls,
1483 GNUNET_break (0); 1485 GNUNET_break (0);
1484 GNUNET_PEERSTORE_iteration_stop (queue->handshake_ack_monotime_get); 1486 GNUNET_PEERSTORE_iteration_stop (queue->handshake_ack_monotime_get);
1485 queue->handshake_ack_monotime_get = NULL; 1487 queue->handshake_ack_monotime_get = NULL;
1488 // FIXME: Why should we try to gracefully finish here?
1486 queue_finish (queue); 1489 queue_finish (queue);
1487 return; 1490 return;
1488 } 1491 }
@@ -1908,8 +1911,7 @@ try_handle_plaintext (struct Queue *queue)
1908 if (sizeof(*tca) > queue->pread_off) 1911 if (sizeof(*tca) > queue->pread_off)
1909 { 1912 {
1910 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1913 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1911 "Handling plaintext size of tca greater than pread offset.\n") 1914 "Handling plaintext size of tca greater than pread offset.\n");
1912 ;
1913 return 0; 1915 return 0;
1914 } 1916 }
1915 if (ntohs (hdr->size) != sizeof(*tca)) 1917 if (ntohs (hdr->size) != sizeof(*tca))
@@ -2123,7 +2125,7 @@ queue_read (void *cls)
2123 if ((EAGAIN != errno) && (EINTR != errno)) 2125 if ((EAGAIN != errno) && (EINTR != errno))
2124 { 2126 {
2125 GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "recv"); 2127 GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "recv");
2126 queue_finish (queue); 2128 queue_destroy (queue);
2127 return; 2129 return;
2128 } 2130 }
2129 /* try again */ 2131 /* try again */
@@ -2140,7 +2142,7 @@ queue_read (void *cls)
2140 GNUNET_STRINGS_relative_time_to_string ( 2142 GNUNET_STRINGS_relative_time_to_string (
2141 GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, 2143 GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
2142 GNUNET_YES)); 2144 GNUNET_YES));
2143 queue_finish (queue); 2145 queue_destroy (queue);
2144 return; 2146 return;
2145 } 2147 }
2146 if (0 == rcvd) 2148 if (0 == rcvd)
@@ -2222,7 +2224,7 @@ queue_read (void *cls)
2222 GNUNET_STRINGS_relative_time_to_string ( 2224 GNUNET_STRINGS_relative_time_to_string (
2223 GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, 2225 GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
2224 GNUNET_YES)); 2226 GNUNET_YES));
2225 queue_finish (queue); 2227 queue_destroy (queue);
2226} 2228}
2227 2229
2228 2230
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index 344f46f1e..ca191d49d 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -3898,8 +3898,7 @@ free_queue (struct Queue *queue)
3898 tc->details.communicator.queue_tail, 3898 tc->details.communicator.queue_tail,
3899 queue); 3899 queue);
3900 maxxed = (COMMUNICATOR_TOTAL_QUEUE_LIMIT <= 3900 maxxed = (COMMUNICATOR_TOTAL_QUEUE_LIMIT <=
3901 tc->details.communicator. 3901 tc->details.communicator.total_queue_length);
3902 total_queue_length);
3903 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3902 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3904 "Cleaning up queue with length %u\n", 3903 "Cleaning up queue with length %u\n",
3905 queue->queue_length); 3904 queue->queue_length);
@@ -3915,9 +3914,6 @@ free_queue (struct Queue *queue)
3915 } 3914 }
3916 GNUNET_free (qe); 3915 GNUNET_free (qe);
3917 } 3916 }
3918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3919 "Cleaning up queue with length %u\n",
3920 queue->queue_length);
3921 GNUNET_assert (0 == queue->queue_length); 3917 GNUNET_assert (0 == queue->queue_length);
3922 if ((maxxed) && (COMMUNICATOR_TOTAL_QUEUE_LIMIT > 3918 if ((maxxed) && (COMMUNICATOR_TOTAL_QUEUE_LIMIT >
3923 tc->details.communicator.total_queue_length)) 3919 tc->details.communicator.total_queue_length))