diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-23 10:06:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-23 10:06:07 +0000 |
commit | f76e7c10d09a037ffd102a0f4998ba86c5e14f97 (patch) | |
tree | 7e60558b8dfb8223c0b2dc6e9ddcbe9d18bf5e4f /src | |
parent | f44c0036572d5557d2496748a4190a61e40e61ff (diff) | |
download | gnunet-f76e7c10d09a037ffd102a0f4998ba86c5e14f97.tar.gz gnunet-f76e7c10d09a037ffd102a0f4998ba86c5e14f97.zip |
getting rid of unnecessary ignore_shutdown calls
Diffstat (limited to 'src')
-rw-r--r-- | src/arm/arm_api.c | 3 | ||||
-rw-r--r-- | src/arm/test_exponential_backoff.c | 2 | ||||
-rw-r--r-- | src/include/gnunet_client_lib.h | 12 | ||||
-rw-r--r-- | src/util/client.c | 23 | ||||
-rw-r--r-- | src/util/connection.c | 3 |
5 files changed, 3 insertions, 40 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index 6d6cb978f..c15c59875 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c | |||
@@ -470,7 +470,6 @@ handle_response (void *cls, const struct GNUNET_MessageHeader *msg) | |||
470 | GNUNET_CLIENT_disconnect (sc->h->client, GNUNET_NO); | 470 | GNUNET_CLIENT_disconnect (sc->h->client, GNUNET_NO); |
471 | sc->h->client = GNUNET_CLIENT_connect ("arm", sc->h->cfg); | 471 | sc->h->client = GNUNET_CLIENT_connect ("arm", sc->h->cfg); |
472 | GNUNET_assert (NULL != sc->h->client); | 472 | GNUNET_assert (NULL != sc->h->client); |
473 | GNUNET_CLIENT_ignore_shutdown (sc->h->client, GNUNET_YES); | ||
474 | if (sc->callback != NULL) | 473 | if (sc->callback != NULL) |
475 | sc->callback (sc->cls, GNUNET_SYSERR); | 474 | sc->callback (sc->cls, GNUNET_SYSERR); |
476 | GNUNET_free (sc); | 475 | GNUNET_free (sc); |
@@ -618,7 +617,6 @@ GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, const char *service_name, | |||
618 | } | 617 | } |
619 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 618 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
620 | "arm_api, GNUNET_CLIENT_connect returned non-NULL\n"); | 619 | "arm_api, GNUNET_CLIENT_connect returned non-NULL\n"); |
621 | GNUNET_CLIENT_ignore_shutdown (client, GNUNET_YES); | ||
622 | h->client = client; | 620 | h->client = client; |
623 | } | 621 | } |
624 | LOG (GNUNET_ERROR_TYPE_DEBUG, "arm_api, h->client non-NULL\n"); | 622 | LOG (GNUNET_ERROR_TYPE_DEBUG, "arm_api, h->client non-NULL\n"); |
@@ -673,7 +671,6 @@ GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, const char *service_name, | |||
673 | cb (cb_cls, GNUNET_SYSERR); | 671 | cb (cb_cls, GNUNET_SYSERR); |
674 | return; | 672 | return; |
675 | } | 673 | } |
676 | GNUNET_CLIENT_ignore_shutdown (client, GNUNET_YES); | ||
677 | h->client = client; | 674 | h->client = client; |
678 | } | 675 | } |
679 | if (0 == strcasecmp ("arm", service_name)) | 676 | if (0 == strcasecmp ("arm", service_name)) |
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index ec2f4545d..3ff4d284f 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c | |||
@@ -188,7 +188,7 @@ write_shutdown (void *cls, size_t size, void *buf) | |||
188 | 188 | ||
189 | if (size < sizeof (struct GNUNET_MessageHeader)) | 189 | if (size < sizeof (struct GNUNET_MessageHeader)) |
190 | { | 190 | { |
191 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 191 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
192 | _("Failed to transmit shutdown request to client.\n")); | 192 | _("Failed to transmit shutdown request to client.\n")); |
193 | shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_SYSERR); | 193 | shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_SYSERR); |
194 | GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO); | 194 | GNUNET_CLIENT_disconnect (shutdown_ctx->sock, GNUNET_NO); |
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index a96215886..60fa938c8 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -59,18 +59,6 @@ GNUNET_CLIENT_connect (const char *service_name, | |||
59 | 59 | ||
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Configure this connection to ignore shutdown signals. | ||
63 | * | ||
64 | * @param h client handle | ||
65 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | ||
66 | */ | ||
67 | void | ||
68 | GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | ||
69 | int do_ignore); | ||
70 | |||
71 | |||
72 | |||
73 | /** | ||
74 | * Destroy connection with the service. This will automatically | 62 | * Destroy connection with the service. This will automatically |
75 | * cancel any pending "receive" request (however, the handler will | 63 | * cancel any pending "receive" request (however, the handler will |
76 | * *NOT* be called, not even with a NULL message). Any pending | 64 | * *NOT* be called, not even with a NULL message). Any pending |
diff --git a/src/util/client.c b/src/util/client.c index 5d5387ef9..d2f347947 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -242,11 +242,6 @@ struct GNUNET_CLIENT_Connection | |||
242 | int in_receive; | 242 | int in_receive; |
243 | 243 | ||
244 | /** | 244 | /** |
245 | * Are we ignoring shutdown signals? | ||
246 | */ | ||
247 | int ignore_shutdown; | ||
248 | |||
249 | /** | ||
250 | * How often have we tried to connect? | 245 | * How often have we tried to connect? |
251 | */ | 246 | */ |
252 | unsigned int attempts; | 247 | unsigned int attempts; |
@@ -382,22 +377,6 @@ GNUNET_CLIENT_connect (const char *service_name, | |||
382 | 377 | ||
383 | 378 | ||
384 | /** | 379 | /** |
385 | * Configure this connection to ignore shutdown signals. | ||
386 | * | ||
387 | * @param h client handle | ||
388 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | ||
389 | */ | ||
390 | void | ||
391 | GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | ||
392 | int do_ignore) | ||
393 | { | ||
394 | h->ignore_shutdown = do_ignore; | ||
395 | if (h->sock != NULL) | ||
396 | GNUNET_CONNECTION_ignore_shutdown (h->sock, do_ignore); | ||
397 | } | ||
398 | |||
399 | |||
400 | /** | ||
401 | * Destroy connection with the service. This will automatically | 380 | * Destroy connection with the service. This will automatically |
402 | * cancel any pending "receive" request (however, the handler will | 381 | * cancel any pending "receive" request (however, the handler will |
403 | * *NOT* be called, not even with a NULL message). Any pending | 382 | * *NOT* be called, not even with a NULL message). Any pending |
@@ -960,8 +939,6 @@ client_delayed_retry (void *cls, | |||
960 | GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th); | 939 | GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th); |
961 | return; | 940 | return; |
962 | } | 941 | } |
963 | GNUNET_CONNECTION_ignore_shutdown (th->sock->sock, | ||
964 | th->sock->ignore_shutdown); | ||
965 | th->th = | 942 | th->th = |
966 | GNUNET_CONNECTION_notify_transmit_ready (th->sock->sock, th->size, | 943 | GNUNET_CONNECTION_notify_transmit_ready (th->sock->sock, th->size, |
967 | GNUNET_TIME_absolute_get_remaining | 944 | GNUNET_TIME_absolute_get_remaining |
diff --git a/src/util/connection.c b/src/util/connection.c index 4beafa3f3..cd0035a8f 100644 --- a/src/util/connection.c +++ b/src/util/connection.c | |||
@@ -1495,7 +1495,8 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1495 | GNUNET_assert (sock->nth.timeout_task == GNUNET_SCHEDULER_NO_TASK); | 1495 | GNUNET_assert (sock->nth.timeout_task == GNUNET_SCHEDULER_NO_TASK); |
1496 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1496 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1497 | { | 1497 | { |
1498 | if (sock->ignore_shutdown == GNUNET_YES) | 1498 | if ( (sock->ignore_shutdown == GNUNET_YES) && |
1499 | (NULL != sock->sock) ) | ||
1499 | goto SCHEDULE_WRITE; /* ignore shutdown, go again immediately */ | 1500 | goto SCHEDULE_WRITE; /* ignore shutdown, go again immediately */ |
1500 | #if DEBUG_CONNECTION | 1501 | #if DEBUG_CONNECTION |
1501 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1502 | LOG (GNUNET_ERROR_TYPE_DEBUG, |