diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-21 20:43:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-21 20:43:27 +0000 |
commit | a76817c408f2d8cf3b0b8619ff38f163ee882be6 (patch) | |
tree | 0ea324b5ba2ce030ef78395003ef7f54281f3731 /src/util/connection.c | |
parent | 8b4685c894e24dbd9fed9457b4eec9045a0994ed (diff) | |
download | gnunet-a76817c408f2d8cf3b0b8619ff38f163ee882be6.tar.gz gnunet-a76817c408f2d8cf3b0b8619ff38f163ee882be6.zip |
fix TCP plugin RC issue (#3687) by changing util API (!)
Diffstat (limited to 'src/util/connection.c')
-rw-r--r-- | src/util/connection.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/util/connection.c b/src/util/connection.c index b600baa12..f6dab2bc4 100644 --- a/src/util/connection.c +++ b/src/util/connection.c | |||
@@ -421,9 +421,11 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb, | |||
421 | if (GNUNET_NO == aret) | 421 | if (GNUNET_NO == aret) |
422 | LOG (GNUNET_ERROR_TYPE_INFO, | 422 | LOG (GNUNET_ERROR_TYPE_INFO, |
423 | _("Access denied to `%s'\n"), | 423 | _("Access denied to `%s'\n"), |
424 | GNUNET_a2s (uaddr, addrlen)); | 424 | GNUNET_a2s (uaddr, |
425 | addrlen)); | ||
425 | GNUNET_break (GNUNET_OK == | 426 | GNUNET_break (GNUNET_OK == |
426 | GNUNET_NETWORK_socket_shutdown (sock, SHUT_RDWR)); | 427 | GNUNET_NETWORK_socket_shutdown (sock, |
428 | SHUT_RDWR)); | ||
427 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock)); | 429 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock)); |
428 | GNUNET_free (uaddr); | 430 | GNUNET_free (uaddr); |
429 | return NULL; | 431 | return NULL; |
@@ -525,7 +527,8 @@ signal_transmit_error (struct GNUNET_CONNECTION_Handle *connection, | |||
525 | connection); | 527 | connection); |
526 | if (NULL != connection->sock) | 528 | if (NULL != connection->sock) |
527 | { | 529 | { |
528 | (void) GNUNET_NETWORK_socket_shutdown (connection->sock, SHUT_RDWR); | 530 | (void) GNUNET_NETWORK_socket_shutdown (connection->sock, |
531 | SHUT_RDWR); | ||
529 | GNUNET_break (GNUNET_OK == | 532 | GNUNET_break (GNUNET_OK == |
530 | GNUNET_NETWORK_socket_close (connection->sock)); | 533 | GNUNET_NETWORK_socket_close (connection->sock)); |
531 | connection->sock = NULL; | 534 | connection->sock = NULL; |
@@ -1301,14 +1304,17 @@ connect_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1301 | * @param tc task context describing why we are here | 1304 | * @param tc task context describing why we are here |
1302 | */ | 1305 | */ |
1303 | static void | 1306 | static void |
1304 | transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1307 | transmit_ready (void *cls, |
1308 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1305 | { | 1309 | { |
1306 | struct GNUNET_CONNECTION_Handle *connection = cls; | 1310 | struct GNUNET_CONNECTION_Handle *connection = cls; |
1307 | GNUNET_CONNECTION_TransmitReadyNotify notify; | 1311 | GNUNET_CONNECTION_TransmitReadyNotify notify; |
1308 | ssize_t ret; | 1312 | ssize_t ret; |
1309 | size_t have; | 1313 | size_t have; |
1310 | 1314 | ||
1311 | LOG (GNUNET_ERROR_TYPE_DEBUG, "transmit_ready running (%p).\n", connection); | 1315 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1316 | "transmit_ready running (%p).\n", | ||
1317 | connection); | ||
1312 | GNUNET_assert (NULL != connection->write_task); | 1318 | GNUNET_assert (NULL != connection->write_task); |
1313 | connection->write_task = NULL; | 1319 | connection->write_task = NULL; |
1314 | GNUNET_assert (NULL == connection->nth.timeout_task); | 1320 | GNUNET_assert (NULL == connection->nth.timeout_task); |
@@ -1331,7 +1337,9 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1331 | { | 1337 | { |
1332 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1338 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1333 | "Transmit to `%s' fails, time out reached (%p).\n", | 1339 | "Transmit to `%s' fails, time out reached (%p).\n", |
1334 | GNUNET_a2s (connection->addr, connection->addrlen), connection); | 1340 | GNUNET_a2s (connection->addr, |
1341 | connection->addrlen), | ||
1342 | connection); | ||
1335 | notify = connection->nth.notify_ready; | 1343 | notify = connection->nth.notify_ready; |
1336 | GNUNET_assert (NULL != notify); | 1344 | GNUNET_assert (NULL != notify); |
1337 | connection->nth.notify_ready = NULL; | 1345 | connection->nth.notify_ready = NULL; |